| 97 | */ |
| 98 | |
| 99 | void CountryFinalProcessor::ProcessRoundabouts() |
| 100 | { |
| 101 | auto const roundabouts = ReadMiniRoundabouts(m_miniRoundaboutsFilename); |
| 102 | |
| 103 | AddressesHolder addresses; |
| 104 | addresses.Deserialize(m_addrInterpolFilename); |
| 105 | |
| 106 | ForEachMwmTmp(m_temporaryMwmPath, [&](auto const & name, auto const & path) |
| 107 | { |
| 108 | if (!IsCountry(name)) |
| 109 | return; |
| 110 | |
| 111 | MiniRoundaboutTransformer transformer(roundabouts.GetData(), *m_affiliations); |
| 112 | |
| 113 | RegionData data; |
| 114 | if (ReadRegionData(name, data)) |
| 115 | transformer.SetLeftHandTraffic(data.Get(RegionData::Type::RD_DRIVING) == "l"); |
| 116 | |
| 117 | FeatureBuilderWriter<serialization_policy::MaxAccuracy> writer(path, true /* mangleName */); |
| 118 | ForEachFeatureRawFormat<serialization_policy::MaxAccuracy>(path, [&](FeatureBuilder && fb, uint64_t) |
| 119 | { |
| 120 | if (roundabouts.IsRoadExists(fb)) |
| 121 | transformer.AddRoad(std::move(fb)); |
| 122 | else |
| 123 | { |
| 124 | auto const & checker = ftypes::IsAddressInterpolChecker::Instance(); |
| 125 | // Check HasOsmIds() because we have non-OSM addr:interpolation FBs (Tiger). |
| 126 | if (fb.IsLine() && fb.HasOsmIds() && checker(fb.GetTypes())) |
| 127 | { |
| 128 | if (!addresses.Update(fb)) |
| 129 | { |
| 130 | // Not only invalid interpolation ways, but fancy buildings with interpolation type like here: |
| 131 | // https://www.openstreetmap.org/#map=18/39.45672/-77.97516 |
| 132 | if (fb.RemoveTypesIf(checker)) |
| 133 | return; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | writer.Write(fb); |
| 138 | } |
| 139 | }); |
| 140 | |
| 141 | // Adds new way features generated from mini-roundabout nodes with those nodes ids. |
| 142 | // Transforms points on roads to connect them with these new roundabout junctions. |
| 143 | transformer.ProcessRoundabouts([&writer](FeatureBuilder const & fb) { writer.Write(fb); }); |
| 144 | }, m_threadsCount); |
| 145 | } |
| 146 | |
| 147 | bool DoesBuildingConsistOfParts(FeatureBuilder const & fbBuilding, m4::Tree<m2::RegionI> const & buildingPartsKDTree) |
| 148 | { |
nothing calls this directly
no test coverage detected