Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
KPublicTransport
Commits
08e74206
Commit
08e74206
authored
Sep 10, 2021
by
Volker Krause
Browse files
Support IFOPT station identifiers in OJP/TRIAS responses
parent
e0741a7b
Pipeline
#79853
passed with stage
in 17 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/data/ojp/vvo-location-by-name.json
View file @
08e74206
[
{
"identifier"
:
{
"ifopt"
:
"de:14612:28"
,
"uic"
:
"de:14612:28"
},
"latitude"
:
51.0399284362793
,
...
...
@@ -11,6 +12,7 @@
},
{
"identifier"
:
{
"ifopt"
:
"de:14612:32"
,
"uic"
:
"de:14612:32"
},
"latitude"
:
51.0413703918457
,
...
...
@@ -21,6 +23,7 @@
},
{
"identifier"
:
{
"ifopt"
:
"de:14612:36"
,
"uic"
:
"de:14612:36"
},
"latitude"
:
51.038719177246094
,
...
...
src/lib/backends/openjourneyplannerparser.cpp
View file @
08e74206
...
...
@@ -8,6 +8,7 @@
#include
"scopedxmlstreamreader.h"
#include
<gtfs/hvt.h>
#include
<ifopt/ifoptutil.h>
#include
<KPublicTransport/Journey>
#include
<KPublicTransport/Location>
...
...
@@ -102,7 +103,11 @@ Location OpenJourneyPlannerParser::parseLocationInformationLocation(ScopedXmlStr
auto
subR
=
r
.
subReader
();
while
(
subR
.
readNextSibling
())
{
if
(
subR
.
isElement
(
"StopPlaceRef"
)
||
subR
.
isElement
(
"StopPointRef"
))
{
loc
.
setIdentifier
(
m_identifierType
,
subR
.
readElementText
());
const
auto
id
=
subR
.
readElementText
();
loc
.
setIdentifier
(
m_identifierType
,
id
);
if
(
IfoptUtil
::
isValid
(
id
))
{
loc
.
setIdentifier
(
IfoptUtil
::
identifierType
(),
id
);
}
}
else
if
(
subR
.
isElement
(
"StopPlaceName"
)
||
subR
.
isElement
(
"StopPointName"
))
{
loc
.
setName
(
parseTextElement
(
subR
.
subReader
()));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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