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

Method CollectFeature

generator/collector_building_parts.cpp:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void BuildingPartsCollector::CollectFeature(feature::FeatureBuilder const & fb, OsmElement const &)
89{
90 static auto const & buildingChecker = ftypes::IsBuildingChecker::Instance();
91 if (!fb.IsArea() || !buildingChecker(fb.GetTypes()))
92 return;
93
94 auto const topId = FindTopRelation(fb.GetMostGenericOsmId());
95 if (topId == base::GeoObjectId())
96 return;
97
98 auto parts = FindAllBuildingParts(topId);
99 if (!parts.empty())
100 {
101 BuildingParts bp;
102 bp.m_id = MakeCompositeId(fb);
103 bp.m_buildingParts = std::move(parts);
104
105 BuildingParts::Write(*m_writer, bp);
106 }
107}
108
109std::vector<base::GeoObjectId> BuildingPartsCollector::FindAllBuildingParts(base::GeoObjectId const & id)
110{

Callers

nothing calls this directly

Calls 7

MakeCompositeIdFunction · 0.85
IsAreaMethod · 0.80
GetMostGenericOsmIdMethod · 0.80
GeoObjectIdClass · 0.70
WriteFunction · 0.50
GetTypesMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected