From e2f5005ce81623312639a52c3d99b373d7b704bd Mon Sep 17 00:00:00 2001 From: map-per Date: Fri, 3 Jan 2025 20:38:35 +0100 Subject: [PATCH] Allow more than one number for level Signed-off-by: map-per --- generator/osm2meta.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/generator/osm2meta.cpp b/generator/osm2meta.cpp index b0386b1206..216b379c70 100644 --- a/generator/osm2meta.cpp +++ b/generator/osm2meta.cpp @@ -28,7 +28,6 @@ constexpr char const * kOSMMultivalueDelimiter = ";"; // https://en.wikipedia.org/wiki/List_of_tallest_buildings_in_the_world auto constexpr kMaxBuildingLevelsInTheWorld = 167; -auto constexpr kMinBuildingLevel = -6; template void RemoveDuplicatesAndKeepOrder(std::vector & vec) @@ -229,6 +228,7 @@ std::string MetadataTagProcessorImpl::ValidateAndFormat_building_levels(std::str { // Some mappers use full width unicode digits. We can handle that. strings::NormalizeDigits(v); + // value of building_levels is only one number double levels; if (Prefix2Double(v, levels) && levels >= 0 && levels <= kMaxBuildingLevelsInTheWorld) return strings::to_string_dac(levels, 1); @@ -240,11 +240,8 @@ std::string MetadataTagProcessorImpl::ValidateAndFormat_level(std::string v) { // Some mappers use full width unicode digits. We can handle that. strings::NormalizeDigits(v); - double levels; - if (Prefix2Double(v, levels) && levels >= kMinBuildingLevel && levels <= kMaxBuildingLevelsInTheWorld) - return strings::to_string(levels); - - return {}; + // value of level can be more than one number, so e.g. "1;2" or "3-5" + return v; } std::string MetadataTagProcessorImpl::ValidateAndFormat_denomination(std::string const & v)