Commit e58aa804 authored by Volker Krause's avatar Volker Krause
Browse files

Resolve Via Rail station codes in post-processing

parent c844abae
Pipeline #166519 passed with stages
in 4 minutes and 3 seconds
......@@ -273,6 +273,9 @@ TrainStation ExtractorPostprocessorPrivate::processTrainStation(TrainStation sta
} else if (id.startsWith(QLatin1String("amtrak:")) && id.size() == 10) {
const auto record = KnowledgeDb::stationForAmtrakStationCode(KnowledgeDb::AmtrakStationCode(QStringView(id).mid(7)));
applyStationData(record, station);
} else if (id.startsWith(QLatin1String("via:")) && id.size() == 8) {
const auto record = KnowledgeDb::stationForViaRailStationCode(KnowledgeDb::ViaRailStationCode(QStringView(id).mid(4)));
applyStationData(record, station);
}
return processPlace(station);
......
......@@ -82,3 +82,8 @@ TrainStation KnowledgeDb::stationForAmtrakStationCode(AmtrakStationCode code)
{
return lookupStation(code, amtrak_table);
}
TrainStation KnowledgeDb::stationForViaRailStationCode(ViaRailStationCode code)
{
return lookupStation(code, viarail_table);
}
......@@ -75,6 +75,8 @@ KITINERARY_EXPORT TrainStation stationForIataCode(IataCode iataCode);
/** Lookup train station data by Amtrak station code. */
KITINERARY_EXPORT TrainStation stationForAmtrakStationCode(AmtrakStationCode code);
/** Lookup train station data by Via Rail station code. */
KITINERARY_EXPORT TrainStation stationForViaRailStationCode(ViaRailStationCode 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