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
Libraries
KPublicTransport
Commits
a2320381
Commit
a2320381
authored
Oct 22, 2021
by
Volker Krause
Browse files
Parse OSM identifiers in Navitia responses
Will be useful for matching navigation paths to OSM map data.
parent
91ba055d
Changes
2
Hide whitespace changes
Inline
Side-by-side
autotests/data/navitia/journey-bss-path-no-instr-start-coord.out.json
View file @
a2320381
...
...
@@ -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
,
...
...
src/lib/backends/navitiaparser.cpp
View file @
a2320381
...
...
@@ -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"
))
{
...
...
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