Commit 4cf1aea4 authored by Volker Krause's avatar Volker Krause
Browse files

Use Amtrak and IATA train station codes during post-processing

parent b97674c8
......@@ -257,6 +257,12 @@ TrainStation ExtractorPostprocessorPrivate::processTrainStation(TrainStation sta
} else if (id.startsWith(QLatin1String("vrfi:")) && id.size() >= 7 && id.size() <= 9) {
const auto record = KnowledgeDb::stationForVRStationCode(KnowledgeDb::VRStationCode(id.mid(5)));
applyStationData(record, station);
} else if (id.startsWith(QLatin1String("iata:")) && id.size() == 8) {
const auto record = KnowledgeDb::stationForIataCode(KnowledgeDb::IataCode(QStringView(id).mid(5)));
applyStationData(record, station);
} else if (id.startsWith(QLatin1String("amtrak:")) && id.size() == 10) {
const auto record = KnowledgeDb::stationForAmtrakStationCode(KnowledgeDb::AmtrakStationCode(QStringView(id).mid(7)));
applyStationData(record, station);
}
return processPlace(station);
......
......@@ -72,3 +72,13 @@ TrainStation KnowledgeDb::stationForBenerailId(BenerailStationId id)
{
return lookupStation(id, benerail_table);
}
TrainStation KnowledgeDb::stationForIataCode(IataCode iataCode)
{
return lookupStation(iataCode, iata_table);
}
TrainStation KnowledgeDb::stationForAmtrakStationCode(AmtrakStationCode code)
{
return lookupStation(code, amtrak_table);
}
......@@ -69,6 +69,12 @@ KITINERARY_EXPORT TrainStation stationForVRStationCode(VRStationCode vrStation);
/** Lookup train station data by Benerail station identifier. */
KITINERARY_EXPORT TrainStation stationForBenerailId(BenerailStationId id);
/** Lookup train station data by IATA location code. */
KITINERARY_EXPORT TrainStation stationForIataCode(IataCode iataCode);
/** Lookup train station data by Amtrak station code. */
KITINERARY_EXPORT TrainStation stationForAmtrakStationCode(AmtrakStationCode code);
}
}
Supports Markdown
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