diff --git a/generator/isolines_generator.cpp b/generator/isolines_generator.cpp index ede7de30ee..39a73a97e4 100644 --- a/generator/isolines_generator.cpp +++ b/generator/isolines_generator.cpp @@ -9,19 +9,30 @@ namespace generator { namespace { +static std::vector const kAltClasses = {1000, 500, 100, 50, 10}; +static std::vector const kNamedAltClasses = {1000, 500, 100, 50}; +static std::string const kTypePrefix = "step_"; + std::string GetIsolineType(topography_generator::Altitude altitude) { - static std::vector const altClasses = {1000, 500, 100, 50, 10}; - ASSERT(std::is_sorted(altClasses.cbegin(), altClasses.cend(), std::greater()), ()); - - std::string const kPrefix = "step_"; + ASSERT(std::is_sorted(kAltClasses.cbegin(), kAltClasses.cend(), std::greater()), ()); if (altitude == 0) - return kPrefix + strings::to_string(altClasses.back()); + return kTypePrefix + strings::to_string(kAltClasses.back()); - for (auto altStep : altClasses) + for (auto altStep : kAltClasses) { if (altitude % altStep == 0) - return kPrefix + strings::to_string(altStep); + return kTypePrefix + strings::to_string(altStep); + } + return ""; +} + +std::string GetIsolineName(topography_generator::Altitude altitude) +{ + for (auto altStep : kNamedAltClasses) + { + if (altitude % altStep == 0) + return strings::to_string(altitude); } return ""; } @@ -43,7 +54,7 @@ void IsolineFeaturesGenerator::GenerateIsolines(std::string const & countryName, for (auto const & levelIsolines : countryIsolines.m_contours) { auto const altitude = levelIsolines.first; - auto const isolineName = strings::to_string(altitude); + auto const isolineName = GetIsolineName(altitude); auto const isolineType = GetIsolineType(altitude); if (isolineType.empty()) { @@ -60,7 +71,8 @@ void IsolineFeaturesGenerator::GenerateIsolines(std::string const & countryName, fb.AddPoint(pt); fb.AddType(type); - fb.AddName("default", isolineName); + if (!isolineName.empty()) + fb.AddName("default", isolineName); fbs.emplace_back(std::move(fb)); } } diff --git a/search/types_skipper.cpp b/search/types_skipper.cpp index 3bba58d8af..82adf6aa5d 100644 --- a/search/types_skipper.cpp +++ b/search/types_skipper.cpp @@ -37,6 +37,7 @@ TypesSkipper::TypesSkipper() } m_skipAlways[1].push_back(c.GetTypeByPath({"sponsored", "partner18"})); m_skipAlways[1].push_back(c.GetTypeByPath({"sponsored", "partner19"})); + m_skipAlways[0].push_back(c.GetTypeByPath({"isoline"})); } void TypesSkipper::SkipEmptyNameTypes(feature::TypesHolder & types) const