MCPcopy Create free account
hub / github.com/comaps/comaps / DeserializeAccuratelyFromIntermediate

Method DeserializeAccuratelyFromIntermediate

generator/feature_builder.cpp:487–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487void FeatureBuilder::DeserializeAccuratelyFromIntermediate(Buffer & data)
488{
489 ArrayByteSource source(&data[0]);
490 m_params.Read(source);
491
492 m_limitRect.MakeEmpty();
493
494 if (IsPoint())
495 {
496 rw::ReadPOD(source, m_center);
497 m_limitRect.Add(m_center);
498 }
499 else
500 {
501 uint32_t const count = ReadVarUint<uint32_t>(source);
502 ASSERT_GREATER(count, 0, (*this));
503 m_polygons.resize(count);
504
505 for (auto & poly : m_polygons)
506 {
507 poly.clear();
508 rw::ReadVectorOfPOD(source, poly);
509 CalcRect(poly, m_limitRect);
510 }
511
512 m_coastCell = ReadVarInt<int64_t>(source);
513 }
514
515 rw::ReadVectorOfPOD(source, m_osmIds);
516
517 CHECK(IsValid(), (*this));
518}
519
520void FeatureBuilder::AddOsmId(base::GeoObjectId id)
521{

Callers 3

DeserializeMethod · 0.80
UNIT_CLASS_TESTFunction · 0.80

Calls 9

ReadPODFunction · 0.85
ReadVectorOfPODFunction · 0.85
CalcRectFunction · 0.85
MakeEmptyMethod · 0.80
IsValidFunction · 0.50
ReadMethod · 0.45
AddMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.64