mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[styles] Add disused business POIs (e.g. disused:shop)
Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
@@ -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); }},
|
||||
|
||||
Reference in New Issue
Block a user