Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
4cf1aea4
Commit
4cf1aea4
authored
Feb 17, 2022
by
Volker Krause
Browse files
Use Amtrak and IATA train station codes during post-processing
parent
b97674c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/extractorpostprocessor.cpp
View file @
4cf1aea4
...
...
@@ -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
);
...
...
src/lib/knowledgedb/trainstationdb.cpp
View file @
4cf1aea4
...
...
@@ -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
);
}
src/lib/knowledgedb/trainstationdb.h
View file @
4cf1aea4
...
...
@@ -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
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment