-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Issue
I’ve observed the following behaviour: When using OSRM’s routing API with only start and end points (2-point route), alternative routes are returned. However, when requesting a route with multiple waypoints (for example: start → waypoint1 → waypoint2 → end), the service does not return any alternative routes—only a single route is provided.
According to the documentation, the alternatives parameter is supported. Nevertheless, even when I set alternatives=true or alternatives=2, the request with multiple waypoints still returns only one route.
Request example:
/route/v1/driving/{lon1},{lat1};{lon2},{lat2};{lon3},{lat3}?alternatives=true&steps=true&geometries=geojson
→ Only a single route is returned.
Expected behaviour:
When the route includes more than two points (i.e., waypoints), if alternatives is requested, multiple alternative routes should be returned (up to the number requested).
Observations:
– With two points: alternatives are returned.
– With three or more points: no alternatives returned.
The documentation states: “Passing a number alternatives=n searches for up to n alternative routes. *Please note that even if alternative routes are requested, a result cannot be guaranteed.”
Thus, it might be a known limitation, but it's not clearly documented that it applies only to two-point routes.
Could you please clarify whether this is an intended limitation (i.e., alternatives not supported for multiple waypoint routing) or a bug/feature-gap? I’d like to submit this as an issue if needed.
Thank you.
osrm-backendversion being used: 5.25.0 and 6.0.0