Plan a round trip - allow loop
Would it be possible to plan a roundtrip in one step?
My current way to do it is to plan a route from > to and to > from, and choose from the original and alternative the routes with biggest difference from each others. This should be possible to combine into one step, and offer to the user several possible alternatives.
For an easier method, simply take the from > to route (original + alternatives) and get the roundtrip from this one, again choose the combination with biggest difference. There is the half manual way to do it as well - simply let the user to choose the combination of the routes, just show them which routes are suggested for the route to the selected place and back again.
Hello @majkaz, indeed it could be a nice feature - not sure how we'd do that, I think this is (technically) related to #68 since we would need to ask brouter multiple routes, but not sure how to tell it to avoid going back on the same route?
@bagage Maybe we could use the nogo polyline feature, with a buffer on the second (way back) route?
We currently can only assign route options (profile and alternatives) to the whole route and not individual segments, both in the client and the server (Export requests the whole route). Maintaining, passing and processing options per segment would be useful for several features.
not sure how to tell it to avoid going back on the same route
I think that is how the alternatives work: the engine always starts with the best route (original) and then calculates again, avoiding ways taken in the previous ones, repeating n times for the n-th alternative.
So as majkaz suggests, combining e.g. the original "alternative" with some other n-th alternative on the way back would do the trick to get some sort of round trip when setting two points.
A similar feature that I would like to have is suggested round trips by specifying a start point and a distance. But that would require some special route optimization algorithm in the engine.
As an example, cycle.travel has both ("Round-trip" and "Suggest a ride").
Hello,
I think this issue can take a new start since the brouter engine version 1.7.8 from July 2025 now has a mode (engineMode=4) to generate round trips!
https://github.com/abrensch/brouter/blob/master/docs/developers/android_service.md#round-trip
The starting point and roundTripDistance would be IMO the most important parameters from a frontend, brouter-web, POV. Otherwise, apart from the starting point, every parameter has a default.
See also https://github.com/abrensch/brouter/issues/460