[generator] Pull route=hiking tag and trail names from relations

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin 2023-11-29 19:50:41 +02:00
parent 88d081979d
commit f285fbce37

View file

@ -144,7 +144,25 @@ void RelationTagsWay::Process(RelationElement const & e)
if (route == "bicycle")
Base::AddCustomTag({"bicycle", "yes"});
else if (route == "foot" || route == "hiking")
{
Base::AddCustomTag({"foot", "yes"});
if (route == "hiking")
{
auto const hwValue = m_current->GetTag("highway");
if (hwValue == "path" || hwValue == "track")
{
Base::AddCustomTag({"route", "hiking"});
if (!Base::IsKeyTagExists("name"))
{
std::string name(e.GetTagValue("name"));
if (!name.empty()) //pastk: prefer name from the most local network
Base::AddCustomTag({"name", std::move(name)});
}
}
}
}
}
if (!fetchTags)