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

Method ProcessBuildingParts

generator/final_processor_country.cpp:216–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void CountryFinalProcessor::ProcessBuildingParts()
217{
218 auto const & buildingChecker = ftypes::IsBuildingChecker::Instance();
219 auto const & buildingPartChecker = ftypes::IsBuildingPartChecker::Instance();
220 auto const & buildingHasPartsChecker = ftypes::IsBuildingHasPartsChecker::Instance();
221
222 ForEachMwmTmp(m_temporaryMwmPath, [&](auto const & name, auto const & path)
223 {
224 if (!IsCountry(name))
225 return;
226
227 // All "building:part" regions in MWM
228 m4::Tree<m2::RegionI> buildingPartsKDTree;
229
230 ForEachFeatureRawFormat<serialization_policy::MaxAccuracy>(path, [&](FeatureBuilder && fb, uint64_t)
231 {
232 if (fb.IsArea() && buildingPartChecker(fb.GetTypes()))
233 {
234 // Important trick! Add region by FeatureBuilder's native rect, to make search queries also by FB rects.
235 buildingPartsKDTree.Add(coastlines_generator::CreateRegionI(fb.GetOuterGeometry()), fb.GetLimitRect());
236 }
237 });
238
239 FeatureBuilderWriter<serialization_policy::MaxAccuracy> writer(path, true /* mangleName */);
240 ForEachFeatureRawFormat<serialization_policy::MaxAccuracy>(path, [&](FeatureBuilder && fb, uint64_t)
241 {
242 if (fb.IsArea() && buildingChecker(fb.GetTypes()) && DoesBuildingConsistOfParts(fb, buildingPartsKDTree))
243 {
244 fb.AddType(buildingHasPartsChecker.GetType());
245 fb.GetParams().FinishAddingTypes();
246 }
247
248 writer.Write(fb);
249 });
250 }, m_threadsCount);
251}
252
253void CountryFinalProcessor::AddIsolines()
254{

Callers 1

UNIT_TESTFunction · 0.80

Calls 12

ForEachMwmTmpFunction · 0.85
CreateRegionIFunction · 0.85
IsAreaMethod · 0.80
FinishAddingTypesMethod · 0.80
GetParamsMethod · 0.80
GetTypesMethod · 0.45
AddMethod · 0.45
GetLimitRectMethod · 0.45
AddTypeMethod · 0.45
GetTypeMethod · 0.45
WriteMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64