diff --git a/generator/camera_info_collector.cpp b/generator/camera_info_collector.cpp index e25dd94a86..665d900fdd 100644 --- a/generator/camera_info_collector.cpp +++ b/generator/camera_info_collector.cpp @@ -17,7 +17,6 @@ #include #include -#include namespace generator { @@ -317,6 +316,34 @@ void CamerasInfoCollector::Camera::Serialize(FileWriter & writer, routing::SerializeSpeedCamera(writer, m_data, prevFeatureId); } +bool IsCamerasInfoProhibited(std::string const & mwmName) +{ + std::vector const kMwmBlockList = { + "Cyprus", + "Macedonia", + "Switzerland_Central", + "Switzerland_Eastern", + "Switzerland_Espace Mittelland_Bern", + "Switzerland_Espace Mittelland_East", + "Switzerland_Lake Geneva region", + "Switzerland_Northwestern", + "Switzerland_Ticino", + "Switzerland_Zurich", + "Turkey_Aegean Region", + "Turkey_Black Sea Region", + "Turkey_Central Anatolia Region_Ankara", + "Turkey_Central Anatolia Region_Kayseri", + "Turkey_Eastern Anatolia Region", + "Turkey_Marmara Region_Bursa", + "Turkey_Marmara Region_Istanbul", + "Turkey_Mediterranean Region", + "Turkey_Southeastern Anatolia Region", + }; + CHECK(is_sorted(kMwmBlockList.cbegin(), kMwmBlockList.cend()), ()); + + return std::binary_search(kMwmBlockList.cbegin(), kMwmBlockList.cend(), mwmName); +} + void BuildCamerasInfo(std::string const & dataFilePath, std::string const & camerasInfoPath, std::string const & osmIdsToFeatureIdsPath) diff --git a/generator/camera_info_collector.hpp b/generator/camera_info_collector.hpp index 1d50c51ec8..1fe8f33fb6 100644 --- a/generator/camera_info_collector.hpp +++ b/generator/camera_info_collector.hpp @@ -21,7 +21,6 @@ #include "base/geo_object_id.hpp" #include -#include #include #include #include @@ -87,6 +86,10 @@ private: std::vector m_cameras; }; +/// \returns true if any information about speed cameras is prohibited in |mwmName|. +/// \param mwmName is mwm name without extention. E.g. "Russia_Moscow". +bool IsCamerasInfoProhibited(std::string const & mwmName); + // To start building camera info, the following data must be ready: // 1. GenerateIntermediateData(). Cached data about camera node to ways. // 2. GenerateFeatures(). Data about cameras from OSM. diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index df6133f20e..082b21c8fd 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -520,10 +520,18 @@ int GeneratorToolMain(int argc, char ** argv) if (FLAGS_generate_cameras) { - string const camerasFilename = - genInfo.GetIntermediateFileName(CAMERAS_TO_WAYS_FILENAME); + if (IsCamerasInfoProhibited(country)) + { + LOG(LINFO, + ("Cameras info is prohibited for", country, "and speedcams section is not generated.")); + } + else + { + string const camerasFilename = + genInfo.GetIntermediateFileName(CAMERAS_TO_WAYS_FILENAME); - BuildCamerasInfo(datFile, camerasFilename, osmToFeatureFilename); + BuildCamerasInfo(datFile, camerasFilename, osmToFeatureFilename); + } } if (FLAGS_make_routing_index)