Turn by turn navigation for GPX tracks… everything you NEVER wanted to know. - Scenic Skip to main content
Background Knowledge

Turn by turn navigation for GPX tracks… everything you NEVER wanted to know.

By 27.09.201616 Comments

Lately I’ve been getting questions about why, in Scenic, it’s sometimes necessary to manually edit a route to make it match the GPX track. In order to explain this I need to first lay out how Scenic imports GPX files and why it works the way it does. So, here we go.

Hard to get it right

First of all, Scenic is currently the only app of its kind that can make any GPX track navigable. There is a reason why none of the other apps have attempted this so far. It’s hard to get it right!

What is a GPX track really?

A GPX track (or GPX route for that matter) is, in essence, just an ordered list of coordinates. There is no knowledge of the underlying road network in a GPX. A coordinate can be on a paved road, on a hiker trail or even somewhere in the middle of the ocean. GPX doesn’t know and doesn’t care. With just the GPX you can only connect all the coordinates with a straight line and draw that line on the screen.

In 200 feet turn right…or… in 200 feet take the exit?

To give correct turn by turn (and voice) instructions, knowledge of the underlying road network is required. For example. If the line on screen bends right, you need to know if this is a roundabout, a highway exit, a right turn at a crossing or the road just makes a bend, otherwise you can’t give the correct turn instruction. So, somehow the ordered list of coordinates needs to be ‘snapped’ to the underlying road network. This ‘snapping’ is part of ’calculating’ the route. There is more to the calculation though. Roughly, these are the steps:

  1. Determine for each point on which road it is located
  2. Determine the route parts (fastest/shortest roads to get from one point to the next)
  3. Connect all those route parts together to get the full route

Crash, choke and freeze

As you can imagine, this calculation is not an easy task and requires a lot of performance. So much performance in fact that navigation apps limit the number of via points. For example, at the moment of writing, Google Maps on iOS limits the number of via points (they call it stops) to 10. Sygic limits it to 48 and Navigon to 24.

Scenic currently supports up to 100 via points and I’m working on increasing this to 200, but still a limitation remains. This limitation is the key to the difficulty in making a GPX track navigable. A GPX track typically contains hundreds, often thousands of coordinates. Simply feeding all those coordinates to the route calculation would cause apps to crash, choke or freeze.

The Scenic Trick

So, how does Scenic do it then? Well, Scenic uses a ‘trick’. Before feeding the GPX coordinates to the route calculation Scenic reduces them. This sounds simple, but it really is not. For example you can’t just feed it point number 1, 10, 20, etc. Well, you could, but more often than not this will result in a calculated route that differs a lot from the actual GPX track. Who can guarantee that the calculated route between point 1 and 10 actually passes points 2 through 9 along the way? After all, these ‘intermediate’ points were not fed to the route calculation. So, you need to choose the reduced points carefully in order to ‘force’ the route calculation to take the ‘right’ roads.

Unfortunately, there is no full proof way to do this, but, you can get very close by reducing the points in a ‘smart’ way. In other words, by selectively choosing which points to feed (and which points not to feed) to the route calculation. Scenic does this through, what I call, its ’Scenify’ algorithm. It’s quite complicated but to say it simple, Scenic leaves more points where the line bends and less points where the line is straight (without knowledge of the underlying road network). However, no matter how smart I can make the Scenify algorithm the fact remains that there can never be a 100% guarantee that the route calculation chooses the roads where the intermediate (left out) points are on. And this is what can cause differences between the calculated route and the GPX track. And this is why, if necessary, Scenic allows you to manually add, move or delete via points to make the calculated route match the GPX track exactly.

Side Note

There is another way of snapping the GPX to the existing road network, without reducing the points, but for that you need to have deep access to the underlying map data. Because Scenic uses a third party map framework this is not possible, but I do imagine this is the method that GPS units like the Garmin’s and TomTom’s use.

I totally get it

Having said all this, I want to emphasise that I totally get why people are asking me about the calculated route not matching the GPX. All the above is not something you should be worried about (or even know about). GPX import should just work!

As we speak I’m working on improving the ‘Scenify’ algorithm and eventually hope to reach a match for nearly 100% of all GPX tracks.

Should you have any questions, feedback or suggestions… they are more than welcome. Feel free to leave a comment below.

—Guido

Guido

Guido

Independent Developer of ScenicApp

16 Comments

  • Keith says:

    I for one am happy to go to the minor trouble of tweaking the initially generated route given the benefits of what the Scenic app provides.

    Keep up the great work!

  • Jean-Michel BALLAUX says:

    Here is a very good explanation that will help to create GPX best suited for import of optimal way in Scenic!

  • Uwe Betz says:

    Thanks for the detailed explanation which absolutely makes sense. I really appreciate what you have developped so far as there is nothing comparable available as an App.
    Looking forward what comes next.

  • Henk de Jong says:

    I do no understand completely. If I record an GPX with for instance maps3d it results in ‘hundreds’ of points. And I can later follow the track on the map with even an old ipad mini 1 without a crash. What is the problem? Is that the translation into instructions? Especialy if the instructions follow fast after each other?

    • Depends on what you mean with ‘Following’. If following means that the track is drawn on the map (and you are not getting voice and turn by turn instruction) than the app you are using to ‘follow’ the track is not translating it into instruction. It’s simply connecting all the recorded points with a straight line and drawing that line on the map. So, I guess the answer to your question is yes. The problem is the translation into instructions. In other words, when you are only ‘following’ (without turn by turn instructions), the three steps in the route calculation mentioned above are not necessary. Does that explain or did I misunderstand your question?

      • Henk de Jong says:

        Sorry for the late reaction. I had forgotten where I posted this answer. IT is still nog completely clear for me. If I use for instance Roadbook or GPX Navigator it gives me correct directions following a big (self made) GPX file. What is the difference?

      • The difference is turn by turn instructions. I don’t know Road book, but GPX Navigator only shows you the ‘angle’ of the gpx track at your location. It doesn’t show and/or tell you “In 300 meters take exit 24” or “In 100 meters take the 3rd exit on the roundabout”. Hope this explains better?

      • Henk says:

        Indeed . GPX navigator does not give the translation into speech instructions. It presents the arrow and the distance before the “turning point”. Not bad but your instruction is better.

  • Charlie says:

    I appreciate that this is a difficult problem. But I have run into many cases where I try to manually correct the route and Scenic stubbornly refuses to do what I ask. Scenic wants me to make bizarre loops or U turns and no amount of fiddling with via points seems to help. I have a route in Furkot which is about 85 miles and in Scenic it is around 240!

    I know where the route is supposed to go; but if I can’t convey that to Scenic the app is not very useful for navigation.

    • Charlie says:

      I run into the same problem when I try to create the route directly in Scenic instead of importing it.

      I am not sure what is going on but it appears that Scenic believes US 20 in Georgia is one way (it is not).

      • Hi Charlie, thanks for the feedback. For the upcoming update I made a big improvement to the route matching of GPX import. There is another matter that can also influence the routing and it sounds like that might be the problem in this case. That’s the quality of the map data. Scenic uses the Skobbler framework which uses the data of Open Street Maps (OSM). So basically the map, routing (incl guidance instructions) is as good as the OSM data is and I have very limited control over that. Having said that, Skobbler did recently release an update which also includes newer map data. I am working now to implement this in Scenic and expect it to be ready with the next update. I have good hopes this will resolve a lot of these things. 

        Hope this explains. If not or if you have any other feedback please let me know.
        Best Regards,
        Guido

  • Frank Smith says:

    I appreciate these discussions. Very informative. I understand much more now. Bottom line is that if I get a route made with base camp and load into Garmin Nav, same map version, same routing settings probably yield same route. That said, I have found map errors with garmin also. Still using scenic and climbing learning curve. Looking forward to next version!

    I’m getting better at route import also, goes fairly quickly now. Use furkot for route design and love that interface.

  • Igor says:

    Indeed why spend hundreds of dollars for a dedicated device if you own an iOS gadget. But if you don’t?

  • Guido says:

    I’m afraid an Android version is going to be a while. I’m currently focusing on a big update for iOS. After that I will point my attention to Android again.

    If you’d like to stay informed have a look here: http://www.motomappers.com/faqs/faqs.php#android

    Hope this explains. If not, please let me know. 
    Cheers,
    Guido

  • lsulsulsu says:

    must local maps be purchased (with credits) every time a route is started?

Leave a Reply

Solve this if you are human