From 07f0b6c29560a093a4f11e41b18eed6487579378 Mon Sep 17 00:00:00 2001 From: Maksim Andrianov Date: Tue, 17 Dec 2019 14:50:30 +0300 Subject: [PATCH] Review fixes. --- generator/feature_processing_layers.cpp | 15 +++++++-------- generator/feature_processing_layers.hpp | 2 ++ generator/final_processor_intermediate_mwm.cpp | 6 +++--- indexer/feature_data.hpp | 3 +++ indexer/feature_visibility.cpp | 8 ++++++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/generator/feature_processing_layers.cpp b/generator/feature_processing_layers.cpp index a45634f40f..653ebe002e 100644 --- a/generator/feature_processing_layers.cpp +++ b/generator/feature_processing_layers.cpp @@ -262,14 +262,13 @@ void ComplexFeaturesMixer::Process(std::function #include #include #include +#include class CoastlineFeaturesGenerator; diff --git a/generator/final_processor_intermediate_mwm.cpp b/generator/final_processor_intermediate_mwm.cpp index 687f950232..5c13b8fe8a 100644 --- a/generator/final_processor_intermediate_mwm.cpp +++ b/generator/final_processor_intermediate_mwm.cpp @@ -120,7 +120,7 @@ void Sort(std::vector & fbs) }); } -std::string GetCountryNameFormTmpMwmPath(std::string filename) +std::string GetCountryNameFromTmpMwmPath(std::string filename) { strings::ReplaceLast(filename, DATA_FILE_EXTENSION_TMP, ""); return filename; @@ -128,7 +128,7 @@ std::string GetCountryNameFormTmpMwmPath(std::string filename) bool FilenameIsCountry(std::string const & filename, AffiliationInterface const & affiliation) { - return affiliation.HasRegionByName(GetCountryNameFormTmpMwmPath(filename)); + return affiliation.HasRegionByName(GetCountryNameFromTmpMwmPath(filename)); } class PlaceHelper @@ -644,7 +644,7 @@ void ComplexFinalProcessor::Process() std::vector>> futures; ForEachCountry(m_mwmTmpPath, [&](auto const & filename) { auto future = pool.Submit([&, filename]() { - auto countryName = GetCountryNameFormTmpMwmPath(filename); + auto countryName = GetCountryNameFromTmpMwmPath(filename); // https://wiki.openstreetmap.org/wiki/Simple_3D_buildings // An object with tag 'building:part' is a part of a relation with outline 'building' or // is contained in an object with tag 'building'. We will split data and work with diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index 20f4165225..696b3d805f 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -313,6 +313,9 @@ public: feature::Metadata const & GetMetadata() const { return m_metadata; } feature::Metadata & GetMetadata() { return m_metadata; } + void SetMetadata(feature::Metadata && metadata) { m_metadata = std::move(metadata); } + void ClearMetadata() { SetMetadata({}); } + template void Write(Sink & sink) const { diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index a158f0c96d..a41eafa31c 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -223,13 +223,16 @@ namespace /// Add here all exception classificator types: needed for algorithms, /// but don't have drawing rules. + /// Warning: Geometry of features with always existing types will be indexed in mwm on all + /// zoom levels. If you add an always existing type to drawing types, the displacement of icons + /// may work not correctly. bool TypeAlwaysExists(uint32_t type, GeomType g = GeomType::Undefined) { if (!classif().IsTypeValid(type)) return false; static uint32_t const internet = classif().GetTypeByPath({"internet_access"}); - static uint32_t const complex_entry = classif().GetTypeByPath({"complex_entry"}); + static uint32_t const complexEntry = classif().GetTypeByPath({"complex_entry"}); if ((g == GeomType::Line || g == GeomType::Undefined) && HasRoutingExceptionType(type)) return true; @@ -238,7 +241,7 @@ namespace if (g != GeomType::Line && type == internet) return true; - if (type == complex_entry) + if (type == complexEntry) return true; return false; @@ -288,6 +291,7 @@ namespace // Reserved for custom event processing, e.g. fc2018. // if (event == type) // return true; + return false; } } // namespace