| 417 | } |
| 418 | |
| 419 | void FeatureBuilder::DeserializeFromIntermediate(Buffer & data) |
| 420 | { |
| 421 | serial::GeometryCodingParams cp; |
| 422 | |
| 423 | ArrayByteSource source(&data[0]); |
| 424 | m_params.Read(source); |
| 425 | |
| 426 | m_limitRect.MakeEmpty(); |
| 427 | |
| 428 | GeomType const type = m_params.GetGeomType(); |
| 429 | if (type == GeomType::Point) |
| 430 | { |
| 431 | m_center = serial::LoadPoint(source, cp); |
| 432 | m_limitRect.Add(m_center); |
| 433 | } |
| 434 | else |
| 435 | { |
| 436 | uint32_t const count = ReadVarUint<uint32_t>(source); |
| 437 | ASSERT_GREATER(count, 0, (*this)); |
| 438 | m_polygons.resize(count); |
| 439 | |
| 440 | for (auto & poly : m_polygons) |
| 441 | { |
| 442 | poly.clear(); |
| 443 | serial::LoadOuterPath(source, cp, poly); |
| 444 | CalcRect(poly, m_limitRect); |
| 445 | } |
| 446 | |
| 447 | m_coastCell = ReadVarInt<int64_t>(source); |
| 448 | } |
| 449 | |
| 450 | rw::ReadVectorOfPOD(source, m_osmIds); |
| 451 | |
| 452 | CHECK(IsValid(), (*this)); |
| 453 | } |
| 454 | |
| 455 | void FeatureBuilder::SerializeAccuratelyForIntermediate(Buffer & data) const |
| 456 | { |