From e3383cc3498d27c388e0041519b8a07105c1088d Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Mon, 4 Mar 2019 13:24:41 +0300 Subject: [PATCH] Bugfix for Removing speed cameras from geometry index for Turkey, Switzerland, Macedonia and Cyprus. --- generator/feature_sorter.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/generator/feature_sorter.cpp b/generator/feature_sorter.cpp index cb854e420d..cb639d0cae 100644 --- a/generator/feature_sorter.cpp +++ b/generator/feature_sorter.cpp @@ -325,17 +325,18 @@ bool GenerateFinalFeatures(feature::GenerateInfo const & info, string const & na // stores cellIds for middle points CalculateMidPoints midPoints; platform::CountryFile const country(name); - ForEachFromDatRawFormat(srcFilePath, - [&midPoints, &country](FeatureBuilder1 const & ft, uint64_t pos) { - // Removing speed cameras from geometry index for some countries. - if (routing::AreSpeedCamerasProhibited(country) && ft.IsPoint() && - classif().GetTypeByPath({"highway", "speed_camera"})) - { - return; - } + bool const speedCamerasProhibitedMwm = routing::AreSpeedCamerasProhibited(country); + uint32_t const speedCameraType = classif().GetTypeByPath({"highway", "speed_camera"}); + ForEachFromDatRawFormat(srcFilePath, [&speedCamerasProhibitedMwm, &speedCameraType, &midPoints]( + FeatureBuilder1 const & ft, uint64_t pos) { + // Removing point features with speed cameras type from geometry index for some countries. + if (speedCamerasProhibitedMwm && ft.IsPoint() && ft.HasType(speedCameraType)) + { + return; + } - midPoints(ft, pos); - }); + midPoints(ft, pos); + }); // sort features by their middle point midPoints.Sort();