Open vinci1it2000 opened 7 years ago
I check that the last node is missing.
I think this might be related to post-processing on the turn instructions omitting the last coordinate which seems to be the same as the second last coordinate.
what you said is valid for the first url but is not for the second one has the last distance ~= 0. Hence, the last and the second last coordinates are different.
Steps to reproduce
curl -s 'http://router.project-osrm.org/route/v1/driving/9.2222883,45.5163789;9.221927306655532,45.51650000195285?overview=false&overview=full&hints=%3B&annotations=nodes,distance&steps=false' | jq '.routes[0].legs[0].annotation'
{
"nodes": [
1344438658,
1344438579,
269518197,
1344438622
],
"distance": [
0,
6.928318,
0.111226
]
}
curl -s 'http://router.project-osrm.org/route/v1/driving/9.2222883,45.5163789;9.221927306655532,45.51650000195285?overview=false&overview=full&hints=%3B&annotations=nodes,distance&steps=true' | jq '.routes[0].legs[0].annotation'
{
"nodes": [
1344438579,
269518197
],
"distance": [
6.928318,
0.111226
]
}
The problem origin is in missing annotation for the source point. So geometry.annotations
does not correspond to geometry.segment_offsets
and the last annotation is not removed.
The corresponding FIXME is related to the issue.
EDIT: OSM https://www.openstreetmap.org/#map=19/45.51640/9.22223
When running a API route service query using the steps option sometimes it returns two different geometries but same annotations.
Follows a python code to replicate the bug:
This is the response of the code:
First and second urls return different geometries (BUG), while the third (CORRECT) returns the same result with
steps=true
andsteps=false
.Note: when
steps=true
the node length == the annotation length (according to #2511, this is a bug).