Patrick Niklaus wrote:
My solution for that would remove vias if the way through them is a
shortest (duration) path. Technically shortest paths are not unique
(think of grid cities). So this might lead to some route modifications
that don't change the duration of the route but maybe the actual path.

The way to implement this would be by doing a table query with the
vias and removing via j from (i, j, k) if result.durations[i][j] +
result.durations[j][k] == result.durations[i][k].

For 2. the implementation would be pretty straight forward. Using the
match plugin first obtain snapped via coordinates of the trace. Then
apply 1. to minimize the via points.

Brilliant - thank you. Really good ideas and probably much simpler and faster than I'd have managed. :) I think the non-unique shortest path is unlikely to be an issue - most of the routes planned with cycle.travel are rural touring routes on winding roads, rather than in grid cities. Will have a go and report back!

cheers
Richard

_______________________________________________
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to