Commit 17db36de authored by Volker Krause's avatar Volker Krause
Browse files

Resolve UK railway station codes during post-processing

parent 2f48d0f9
......@@ -276,6 +276,9 @@ TrainStation ExtractorPostprocessorPrivate::processTrainStation(TrainStation sta
} else if (id.startsWith(QLatin1String("via:")) && id.size() == 8) {
const auto record = KnowledgeDb::stationForViaRailStationCode(KnowledgeDb::ViaRailStationCode(QStringView(id).mid(4)));
applyStationData(record, station);
} else if (id.startsWith(QLatin1String("uk:")) && id.size() == 6) {
const auto record = KnowledgeDb::stationForUkRailwayStationCode(KnowledgeDb::UKRailwayStationCode(QStringView(id).mid(3)));
applyStationData(record, station);
}
return processPlace(station);
......
......@@ -87,3 +87,8 @@ TrainStation KnowledgeDb::stationForViaRailStationCode(ViaRailStationCode code)
{
return lookupStation(code, viarail_table);
}
TrainStation KnowledgeDb::stationForUkRailwayStationCode(UKRailwayStationCode code)
{
return lookupStation(code, uk_table);
}
......@@ -77,6 +77,9 @@ KITINERARY_EXPORT TrainStation stationForAmtrakStationCode(AmtrakStationCode cod
/** Lookup train station data by Via Rail station code. */
KITINERARY_EXPORT TrainStation stationForViaRailStationCode(ViaRailStationCode code);
/** Lookup train station data by UK railway station code. */
KITINERARY_EXPORT TrainStation stationForUkRailwayStationCode(UKRailwayStationCode 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