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

Method RemoveRelationBuildingParts

generator/final_processor_complex.cpp:144–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144ankerl::unordered_dense::map<base::GeoObjectId, FeatureBuilder> ComplexFinalProcessor::RemoveRelationBuildingParts(
145 std::vector<FeatureBuilder> & fbs)
146{
147 CHECK(m_buildingToParts, ());
148
149 auto it = std::partition(std::begin(fbs), std::end(fbs), [&](auto const & fb)
150 { return !m_buildingToParts->HasBuildingPart(fb.GetMostGenericOsmId()); });
151
152 ankerl::unordered_dense::map<base::GeoObjectId, FeatureBuilder> buildingParts;
153 buildingParts.reserve(static_cast<size_t>(std::distance(it, std::end(fbs))));
154
155 std::transform(it, std::end(fbs), std::inserter(buildingParts, std::begin(buildingParts)), [](auto && fb)
156 {
157 auto const id = fb.GetMostGenericOsmId();
158 return std::make_pair(id, std::move(fb));
159 });
160
161 fbs.resize(static_cast<size_t>(std::distance(std::begin(fbs), it)));
162 return buildingParts;
163}
164
165void ComplexFinalProcessor::WriteLines(std::vector<HierarchyEntry> const & lines)
166{

Callers

nothing calls this directly

Calls 7

distanceFunction · 0.85
HasBuildingPartMethod · 0.80
GetMostGenericOsmIdMethod · 0.80
beginFunction · 0.50
endFunction · 0.50
reserveMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected