xmlFeature

Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
map-per
2025-12-11 19:46:53 +01:00
parent bf7cecaa19
commit b3fd89d411

View File

@@ -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<OSMTag> 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)