Commit 08e74206 authored by Volker Krause's avatar Volker Krause
Browse files

Support IFOPT station identifiers in OJP/TRIAS responses

parent e0741a7b
Pipeline #79853 passed with stage
in 17 seconds
[
{
"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,
......
......@@ -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()));
}
......
Markdown is supported
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