valhalla / valhalla/valhalla

trace_route fails on some routes depending on specific pairs of coordinates.

Open
#3,675 9 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C++
Stars
6.2k
Forks
981
Avg merge
2d 14h
Merged PRs (30d)
14

Description

A call to trace_route with the following payload succeeds:

`
{"costing":"auto",
"encoded_polyline":"z{aymAshfjlI}c@oH"}
`

However with the following payload the request fails:
`
{"costing":"auto",
"encoded_polyline":"z{aymAshfjlIib@|@"}
`

With the following error:
`
{
"error_code": 299,
"error": "Unknown:Could not build directions for TripLeg",
"status_code": 400,
"status": "Bad Request"
}
`

Note that in the request that fails any request including those two points (even if those two points are not adjacent) will fail. In my real life example the two points were separated with ~360 other points and the second point was on the return journey however the include of both points in the same request is enough to trigger that error.

`/trace_attributes` with the same payloads will return 200 OK for both requests but will return an empty array for edges with the second payload.

This occurs both on my locally hosted valhalla with data built from OSM as well as on valhalla1.openstreetmap.de
I've finding over 40% of real life traces that I'm using have this issue traced from telematics devices installed in cars - this is just one specific example that I narrowed down to the specific coordinates that caused the problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.