diff --git a/libs/editor/xml_feature.cpp b/libs/editor/xml_feature.cpp index 705430372..d6892de49 100644 --- a/libs/editor/xml_feature.cpp +++ b/libs/editor/xml_feature.cpp @@ -642,44 +642,16 @@ void XMLFeature::RemoveTag(string_view key) void XMLFeature::SetOSMTagsForType(uint32_t type) { - TypeToOSMTranslator const & translator = GetOSMTranslator(); - - auto result = translator.OsmTagsFromType(type); - - ASSERT(!result.empty(), ()); - ASSERT_EQUAL(result[0].key, "amenity", ()); - ASSERT_EQUAL(result[0].value, "restaurant", ()); - - if (ftypes::IsRecyclingCentreChecker::Instance()(type)) - { - SetTagValue("amenity", "recycling"); - SetTagValue("recycling_type", "centre"); - } - else if (ftypes::IsRecyclingContainerChecker::Instance()(type)) - { - SetTagValue("amenity", "recycling"); - SetTagValue("recycling_type", "container"); - } - else if (ftypes::IsAddressChecker::Instance()(type)) + if (ftypes::IsAddressChecker::Instance()(type)) { // Addresses don't have a category tag + return; } - else - { - string const strType = classif().GetReadableObjectName(type); - strings::SimpleTokenizer iter(strType, "-"); - string_view const k = *iter; - if (++iter) - { - // Main type is stored as "k=amenity v=restaurant" - SetTagValue(k, *iter); - } - else { - // Main type is stored as "k=building v=yes" - SetTagValue(k, kYes); - } - } + std::vector osmTags = GetOSMTranslator().OsmTagsFromType(type); + + for(auto const & osmTag : osmTags) + SetTagValue(osmTag.key, osmTag.value); } void XMLFeature::UpdateOSMTag(std::string_view key, std::string_view value)