title: Algorithm for routing based on GPS location and instructions
body: <p>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 :</p>
  <pre><code>&lt;instruction&gt;, &lt;lat, lon&gt;, &lt;distance to next&gt;
  // e.g. &quot;turn left&quot;, &lt;41.4, 12.33&gt;, 1km
  // e.g. &quot;turn slightly right&quot;, &lt;41.5, 12.33&gt;, 0.5km
  </code></pre>
  <p>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.</p>
  <p>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.</p>
  <p>What algorithms are best suited for this scenario?</p>
  <p>Regards,</p>