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

Method DeserializeFromIntermediate

generator/feature_builder.cpp:419–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419void 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
455void FeatureBuilder::SerializeAccuratelyForIntermediate(Buffer & data) const
456{

Callers 3

DeserializeMethod · 0.80
UNIT_CLASS_TESTFunction · 0.80

Calls 11

LoadPointFunction · 0.85
LoadOuterPathFunction · 0.85
CalcRectFunction · 0.85
ReadVectorOfPODFunction · 0.85
MakeEmptyMethod · 0.80
IsValidFunction · 0.50
ReadMethod · 0.45
GetGeomTypeMethod · 0.45
AddMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.64