I have a list of routing instructions generated by some routing service (MapBox, GraphHopper, ...). The instructions are basically a list where each instruction is a vertex of the full directed path :
<instruction>, <lat, lon>, <distance to next>
// e.g. "turn left", <41.4, 12.33>, 1km
// e.g. "turn slightly right", <41.5, 12.33>, 0.5km
The user is located somewhere on the path between two vertices (instructions). Now I want to display the user the current instruction based on the current GPS location.
A naive approach would be to display the closest not-visited instruction but I am sure there are much better algorithms for this which, for instance, also take the movement history into account. I tried to search for algorithms but probably with the wrong search terms.
What algorithms are best suited for this scenario?
Regards,