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

Generate UK railway station code lookup table

parent 7e7bac57
......@@ -41,6 +41,7 @@ bool TrainStationDbGenerator::generate(QIODevice *out)
|| !fetch("P238", "iata", m_iataMap)
|| !fetch("P4803", "amtrak", m_amtrakMap)
|| !fetch("P10653", "viarail", m_viaRailMap)
|| !fetch("P4755", "uk", m_ukMap)
|| !fetchIndianRailwaysStationCode()
|| !fetchFinishStationCodes()
) {
......@@ -70,6 +71,7 @@ namespace KnowledgeDb {
writeIdMap(out, m_iataMap, "iata", "IataCode");
writeIdMap(out, m_amtrakMap, "amtrak", "AmtrakStationCode");
writeIdMap(out, m_viaRailMap, "viarail", "ViaRailStationCode");
writeIdMap(out, m_ukMap, "uk", "UKRailwayStationCode");
writeIndianRailwaysMap(out);
writeVRMap(out);
out->write(R"(
......@@ -407,6 +409,7 @@ void TrainStationDbGenerator::printSummary()
qDebug() << "IATA location code index:" << m_iataMap.size() << "elements";
qDebug() << "Amtrak station code index:" << m_amtrakMap.size() << "elements";
qDebug() << "Via Rail station code index:" << m_viaRailMap.size() << "elements";
qDebug() << "UK railway station code index:" << m_ukMap.size() << "elements";
qDebug() << "Identifier collisions:" << m_idConflicts;
qDebug() << "Identifier format violations:" << m_idFormatViolations;
qDebug() << "Coordinate conflicts:" << m_coordinateConflicts;
......
......@@ -67,6 +67,7 @@ private:
std::map<KnowledgeDb::IataCode, QUrl> m_iataMap;
std::map<KnowledgeDb::AmtrakStationCode, QUrl> m_amtrakMap;
std::map<KnowledgeDb::ViaRailStationCode, QUrl> m_viaRailMap;
std::map<KnowledgeDb::UKRailwayStationCode, QUrl> m_ukMap;
int m_idConflicts = 0;
int m_idFormatViolations = 0;
......
......@@ -126,6 +126,7 @@ private:
using AmtrakStationCode = AlphaId<uint16_t, 3>;
/** Via Rail station code. */
using ViaRailStationCode = AlphaId<UnalignedNumber<3>, 4>;
/** UK railway station code. */
using UKRailwayStationCode = AlphaId<uint16_t, 3>;
}
}
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