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

Parse OSM identifiers in Navitia responses

Will be useful for matching navigation paths to OSM map data.
parent 91ba055d
......@@ -983,6 +983,9 @@
"scheduledArrivalTime": "2021-10-21T17:05:29",
"scheduledDepartureTime": "2021-10-21T17:03:09",
"to": {
"identifier": {
"osm": "n890433076"
},
"latitude": 43.61103439331055,
"locality": "Toulouse",
"longitude": 1.4522922039031982,
......@@ -1000,6 +1003,9 @@
"disruptionEffect": "NormalService",
"distance": 946,
"from": {
"identifier": {
"osm": "n890433076"
},
"latitude": 43.61103439331055,
"locality": "Toulouse",
"longitude": 1.4522922039031982,
......@@ -1454,6 +1460,9 @@
"scheduledArrivalTime": "2021-10-21T17:09:41",
"scheduledDepartureTime": "2021-10-21T17:05:29",
"to": {
"identifier": {
"osm": "n1832846521"
},
"latitude": 43.6047477722168,
"longitude": 1.4496145248413086,
"name": "Carnot - Trois Journées (Toulouse)",
......@@ -1474,6 +1483,9 @@
"disruptionEffect": "NormalService",
"distance": 6,
"from": {
"identifier": {
"osm": "n1832846521"
},
"latitude": 43.6047477722168,
"locality": "Toulouse",
"longitude": 1.4496145248413086,
......
......@@ -113,6 +113,10 @@ static Location parseLocation(const QJsonObject &obj)
loc.setIdentifier(QStringLiteral("uic"), code.value(QLatin1String("value")).toString().left(7));
}
}
const auto id = obj.value(QLatin1String("id")).toString();
if (id.startsWith(QLatin1String("poi:osm:node:"))) {
loc.setIdentifier(QStringLiteral("osm"), QLatin1Char('n') + QStringView(id).mid(13));
}
const auto poi_type = obj.value(QLatin1String("poi_type")).toObject().value(QLatin1String("id")).toString();
if (poi_type == QLatin1String("poi_type:amenity:bicycle_rental")) {
......
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