Commit 2e4d02c4 authored by Volker Krause's avatar Volker Krause
Browse files

Discard light rail stations if we have "real" ones

This helps in sorting out airport-internal train-like transport systems
from externally connected ones (and we only care about the latter).

Improves the station set considered for e.g. CDG or ICN to what one would
expect.
parent 7201156a
......@@ -285,7 +285,6 @@ void OSMAirportDb::loadStation(OSM::Element elem)
void OSMAirportDb::filterStations(OSMAirportData &airport)
{
// if we have a full station, drop halts
// TODO similar filters are probably needed for various tram/subway variants for on-premises transport lines
auto it = std::partition(airport.stations.begin(), airport.stations.end(), [](auto station) {
return station.tagValue("railway") == QLatin1String("station");
});
......@@ -293,6 +292,14 @@ void OSMAirportDb::filterStations(OSMAirportData &airport)
airport.stations.erase(it, airport.stations.end());
}
// drop light_rail in favor of "real" rail, as that's often used for on-premises transport lines
it = std::partition(airport.stations.begin(), airport.stations.end(), [](auto station) {
return station.tagValue("station") != QLatin1String("light_rail");
});
if (it != airport.stations.begin() && it != airport.stations.end()) {
airport.stations.erase(it, airport.stations.end());
}
// "creative" way of separating "real" and on-premises stations: only real ones tend to have Wikidata tags
it = std::partition(airport.stations.begin(), airport.stations.end(), [](auto station) {
return !station.tagValue("wikidata").isEmpty();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment