Skip to content

Commit

Permalink
[generator] Fixed adding duplicated types.
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimandrianov authored and alexey-zakharenkov committed Jan 14, 2021
1 parent 6cdfd4c commit 35d0e83
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions generator/final_processor_country.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,18 @@ void CountryFinalProcessor::ProcessBuildingParts()
m4::Tree<FeatureBuilder> buildingPartsKDTree;

ForEachFeatureRawFormat<serialization_policy::MaxAccuracy>(path, [&](auto && fb, auto /* pos */) {
if (!(fb.IsArea() && fb.IsValid()))
return;

if (fb.HasType(buildingPartClassifType))
if (fb.IsArea() && fb.HasType(buildingPartClassifType))
buildingPartsKDTree.Add(fb);
});

FeatureBuilderWriter<serialization_policy::MaxAccuracy> writer(path, true /* mangleName */);
ForEachFeatureRawFormat<serialization_policy::MaxAccuracy>(path, [&](auto && fb, auto /* pos */) {
if (fb.IsArea() && fb.IsValid() &&
if (fb.IsArea() &&
fb.HasType(buildingClassifType) &&
DoesBuildingConsistOfParts(fb, buildingPartsKDTree))
{
fb.AddType(buildingWithPartsClassifType);
fb.GetParams().FinishAddingTypes();
}

writer.Write(fb);
Expand Down

0 comments on commit 35d0e83

Please sign in to comment.