mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-26 07:43:36 +00:00
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user