mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-19 09:23:52 +00:00
Move special cases for charing stations with implicit car tagging to generator
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -270,6 +270,10 @@ public:
|
||||
ShuttleTrain,
|
||||
DisusedBusiness,
|
||||
Building,
|
||||
ChargingStation,
|
||||
SmallChargingStation,
|
||||
MotorcarChargingStation,
|
||||
CarelessChargingStation,
|
||||
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"}},
|
||||
{CarelessChargingStation, {"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 carelessChargingStation = types.Get(CachedTypes::CarelessChargingStation);
|
||||
|
||||
if (!params.IsTypeExist(motorcarChargingStation) && !params.IsTypeExist(carelessChargingStation))
|
||||
params.AddType(motorcarChargingStation);
|
||||
|
||||
if (params.IsTypeExist(carelessChargingStation))
|
||||
{
|
||||
params.PopExactType(carelessChargingStation);
|
||||
|
||||
uint32_t const smallChargingStation = types.Get(CachedTypes::SmallChargingStation);
|
||||
if (params.IsTypeExist(smallChargingStation))
|
||||
params.PopExactType(smallChargingStation);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user