mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-20 10:13:51 +00:00
[generator] Move special cases for charging stations with implicit car tagging to generator
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com> Co-authored-by: Yannik Bloscheck <git@yannikbloscheck.com> Co-committed-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -270,6 +270,10 @@ public:
|
||||
ShuttleTrain,
|
||||
DisusedBusiness,
|
||||
Building,
|
||||
ChargingStation,
|
||||
SmallChargingStation,
|
||||
MotorcarChargingStation,
|
||||
CarlessChargingStation,
|
||||
Count
|
||||
};
|
||||
|
||||
@@ -311,6 +315,10 @@ public:
|
||||
{ShuttleTrain, {"route", "shuttle_train"}},
|
||||
{DisusedBusiness, {"disusedbusiness"}},
|
||||
{Building, {"building"}},
|
||||
{ChargingStation, {"amenity", "charging_station"}},
|
||||
{SmallChargingStation, {"amenity", "charging_station", "small"}},
|
||||
{MotorcarChargingStation, {"amenity", "charging_station", "motorcar"}},
|
||||
{CarlessChargingStation, {"amenity", "charging_station", "carless"}},
|
||||
};
|
||||
|
||||
m_types.resize(static_cast<size_t>(Count));
|
||||
@@ -1338,6 +1346,25 @@ void PostprocessElement(OsmElement * p, FeatureBuilderParams & params)
|
||||
railwayDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
// This is needed in the generator to work around charing stations, which are only implicitly marked as for cars
|
||||
if (params.IsTypeExist(types.Get(CachedTypes::ChargingStation)))
|
||||
{
|
||||
uint32_t const motorcarChargingStation = types.Get(CachedTypes::MotorcarChargingStation);
|
||||
uint32_t const carlessChargingStation = types.Get(CachedTypes::CarlessChargingStation);
|
||||
|
||||
if (!params.IsTypeExist(motorcarChargingStation) && !params.IsTypeExist(carlessChargingStation))
|
||||
params.AddType(motorcarChargingStation);
|
||||
|
||||
if (params.IsTypeExist(carlessChargingStation))
|
||||
{
|
||||
params.PopExactType(carlessChargingStation);
|
||||
|
||||
uint32_t const smallChargingStation = types.Get(CachedTypes::SmallChargingStation);
|
||||
if (params.IsTypeExist(smallChargingStation))
|
||||
params.PopExactType(smallChargingStation);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user