[styles] Add disused business POIs (e.g. disused:shop)

Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
map-per
2025-10-22 18:56:36 +02:00
committed by map-per
parent da7c3d6710
commit 5886d15e88
9 changed files with 47 additions and 1 deletions

View File

@@ -267,6 +267,8 @@ public:
BicycleOnedir,
Ferry,
ShuttleTrain,
DisusedBusiness,
Building,
Count
};
@@ -306,6 +308,8 @@ public:
{BicycleOnedir, {"hwtag", "onedir_bicycle"}},
{Ferry, {"route", "ferry"}},
{ShuttleTrain, {"route", "shuttle_train"}},
{DisusedBusiness, {"disusedbusiness"}},
{Building, {"building"}},
};
m_types.resize(static_cast<size_t>(Count));
@@ -1074,6 +1078,31 @@ void PostprocessElement(OsmElement * p, FeatureBuilderParams & params)
}
}
// Clear POI attributes for disused businesses (e.g. disused:shop)
for (uint32_t t : params.m_types)
{
if (t == types.Get(CachedTypes::DisusedBusiness))
{
// Avoid removing attributes in cases where e.g. shop AND disused:shop are present
bool hasPoiType = false;
for (uint32_t type : params.m_types)
{
ftype::TruncValue(type, 1);
if (type != types.Get(CachedTypes::WheelchairAny) && type != types.Get(CachedTypes::InternetAny)
&& type != types.Get(CachedTypes::DisusedBusiness) && type != types.Get(CachedTypes::Building))
{
hasPoiType = true;
break;
}
}
if (!hasPoiType)
params.ClearPOIAttribs();
break;
}
}
// Process yes/no tags.
TagProcessor(p).ApplyRules({
{"wheelchair", "designated", [&AddParam] { AddParam(CachedTypes::WheelchairYes); }},