Open MichalPP opened 6 years ago
@MichalPP You might want to investigate using the continue_straight=true
API parameter - this will force waypoints in the middle to continue in the direction that the the waypoint was arrived at, preventing this kind of retracing-your-steps behaviour.
continue_straight
does not help. it only tells to continue straight, so it helps only when the waypoint is on a long edge. It fails in situations when the waypoint is at the end of the dead-end road or on a small side road: router then returns to the road (which shares a lot with the way to the waypoint)
@MichalPP ok - if continue_straight
isn't going to work for you, then it'll need some fairly major work in the routing algorithm side.
Fundamentally, OSRM's two main (current) algorithms, CH and MLD, structure the routing graph optimized for finding shortest paths quickly. To do this, they exclude paths like you want here - these paths simply aren't available to the routing algorithm.
I'm going to mark this as a feature request, but I don't see anyone working on it any time soon.
@danpat do I understand calculation of route A->B->C
as two separate calculations A->B
and B->C
(by CH or MLD) which are then sewed together? this would fairly easy allowed to solve this feature request. plus it would also allow to publish alternatives for routes with waypoints.
while routing
A -> B -> C
sometimes the segmentsA->B
andB->C
share a large segment of the trip. this is very undesirable with hiking or tourism routing. an extreme example. It would be nice that the route from start to 1 would go over the blue road. when routing directly start to 1, the route also shows alt routes which would be more fitting for the previous case.a naive implementation would be to calculate
A->B
andB->C
including all alternatives and then choose routeA->B->C
of the alternative which share the least of geometry.please change subject so that it describes the topic in a better way