{"id":782,"date":"2016-09-27T22:21:20","date_gmt":"2016-09-27T20:21:20","guid":{"rendered":"https:\/\/scenicapp.space\/blog\/?p=782"},"modified":"2016-09-28T13:33:05","modified_gmt":"2016-09-28T11:33:05","slug":"turn-turn-instructions-gpx-tracks-everything-never-wanted-know","status":"publish","type":"post","link":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/","title":{"rendered":"Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know."},"content":{"rendered":"<p>Lately I\u2019ve been getting questions about why, in <a href=\"https:\/\/itunes.apple.com\/app\/id1089668246\">Scenic<\/a>, it\u2019s 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.<\/p>\n<h3>Hard to get it right<\/h3>\n<p>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\u2019s hard to get it right!<\/p>\n<h3>What is a GPX track really?<\/h3>\n<p>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\u2019t know and doesn\u2019t care. With just the GPX you can only connect all the coordinates with a straight line and draw that line on the screen.<\/p>\n<h3>In 200 feet\u00a0turn right&#8230;or&#8230; in 200 feet take the exit?<\/h3>\n<p>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\u2019t give the correct turn instruction. So, somehow the ordered list of coordinates needs to be \u2018snapped\u2019 to the underlying road network. This \u2018snapping\u2019 is part of \u2019calculating\u2019 the route. There is more to the calculation though. Roughly, these are the steps:<\/p>\n<ol>\n<li>Determine for each point on which road it is located<\/li>\n<li>Determine the route parts (fastest\/shortest roads to\u00a0get from one point to the next)<\/li>\n<li>Connect all those route parts together to get the full route<\/li>\n<\/ol>\n<h3>Crash, choke and freeze<\/h3>\n<p>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.<\/p>\n<p>Scenic currently supports up to 100 via points and I&#8217;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 <strong>hundreds, often thousands<\/strong> of coordinates. Simply feeding all those coordinates to the route calculation would cause apps to crash, choke or freeze.<\/p>\n<h3>The Scenic Trick<\/h3>\n<p>So, how does Scenic do it then? Well, Scenic uses a \u2018trick\u2019. Before feeding the GPX coordinates to the route calculation Scenic reduces them. This sounds simple, but it really is not. For example you can\u2019t just feed it point number 1, 10, 20, etc. Well, you could, but more often than not this will\u00a0result in a calculated route that differs a lot from the actual GPX track. Who can guarantee that the calculated route between point 1 and\u00a010 actually passes points 2 through 9 along the way? After all, these &#8216;intermediate&#8217; points were not fed to the route calculation.\u00a0So, you need to choose the reduced points carefully in order to &#8216;force&#8217; the route calculation to take the &#8216;right&#8217; roads.<\/p>\n<p>Unfortunately, there is no full proof way to do\u00a0this, but, you can get very close by\u00a0reducing the points in a \u2018smart\u2019 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 \u2019Scenify\u2019 algorithm. It\u2019s quite\u00a0complicated 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\u00a0can never be a 100% guarantee that the route calculation chooses the roads where the intermediate (left out) points are on. And <b>this is what can cause\u00a0differences between the calculated route and the GPX track<\/b>. 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.<\/p>\n<h3>Side Note<\/h3>\n<p>There <b>is<\/b> another way of snapping the GPX to the existing road network, <b>without<\/b> 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\u2019s and TomTom\u2019s use.<\/p>\n<h3>I totally get it<\/h3>\n<p>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.\u00a0All the above\u00a0is not something you should be worried about (or even know about). GPX import should just work!<\/p>\n<p>As we speak I\u2019m working on improving the \u2018Scenify\u2019 algorithm and eventually hope to reach a match for nearly 100% of all GPX tracks.<\/p>\n<p>Should you have any questions, feedback or suggestions\u2026 they are more than welcome. Feel free to leave a comment below.<\/p>\n<p>\u2014Guido<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lately I\u2019ve been getting questions about why, in Scenic, it\u2019s 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<\/p>\n<p><a class=\"excerpt-more blog-excerpt\" href=\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":""},"categories":[4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know. - ScenicApp<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know. - ScenicApp\" \/>\n<meta property=\"og:description\" content=\"Lately I\u2019ve been getting questions about why, in Scenic, it\u2019s 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 getRead More...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/\" \/>\n<meta property=\"og:site_name\" content=\"ScenicApp\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/motomappers\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-27T20:21:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-09-28T11:33:05+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Guido\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/scenicapp.space\/blog\/#website\",\"url\":\"https:\/\/scenicapp.space\/blog\/\",\"name\":\"ScenicApp\",\"description\":\"Motorcycle Navigation\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/scenicapp.space\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/#webpage\",\"url\":\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/\",\"name\":\"Turn by turn navigation for GPX tracks\\u2026 everything you NEVER wanted to know. - ScenicApp\",\"isPartOf\":{\"@id\":\"https:\/\/scenicapp.space\/blog\/#website\"},\"datePublished\":\"2016-09-27T20:21:20+00:00\",\"dateModified\":\"2016-09-28T11:33:05+00:00\",\"author\":{\"@id\":\"https:\/\/scenicapp.space\/blog\/#\/schema\/person\/cbc1bdcf1026075c6c15eabafa1a1f94\"},\"breadcrumb\":{\"@id\":\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/scenicapp.space\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Turn by turn navigation for GPX tracks\\u2026 everything you NEVER wanted to know.\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/scenicapp.space\/blog\/#\/schema\/person\/cbc1bdcf1026075c6c15eabafa1a1f94\",\"name\":\"Guido\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/scenicapp.space\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/scenicapp.space\/blog\/wp-content\/uploads\/guido.png\",\"contentUrl\":\"https:\/\/scenicapp.space\/blog\/wp-content\/uploads\/guido.png\",\"caption\":\"Guido\"},\"description\":\"Independent Developer of ScenicApp\",\"sameAs\":[\"http:\/\/www.scenicapp.space\",\"http:\/\/www.facebook.com\/motomappers\",\"https:\/\/twitter.com\/@GuidoVanEijsden\"],\"url\":\"https:\/\/scenicapp.space\/blog\/author\/guidomm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know. - ScenicApp","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/","og_locale":"en_US","og_type":"article","og_title":"Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know. - ScenicApp","og_description":"Lately I\u2019ve been getting questions about why, in Scenic, it\u2019s 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 getRead More...","og_url":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/","og_site_name":"ScenicApp","article_author":"http:\/\/www.facebook.com\/motomappers","article_published_time":"2016-09-27T20:21:20+00:00","article_modified_time":"2016-09-28T11:33:05+00:00","twitter_misc":{"Written by":"Guido","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/scenicapp.space\/blog\/#website","url":"https:\/\/scenicapp.space\/blog\/","name":"ScenicApp","description":"Motorcycle Navigation","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/scenicapp.space\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/#webpage","url":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/","name":"Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know. - ScenicApp","isPartOf":{"@id":"https:\/\/scenicapp.space\/blog\/#website"},"datePublished":"2016-09-27T20:21:20+00:00","dateModified":"2016-09-28T11:33:05+00:00","author":{"@id":"https:\/\/scenicapp.space\/blog\/#\/schema\/person\/cbc1bdcf1026075c6c15eabafa1a1f94"},"breadcrumb":{"@id":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/scenicapp.space\/blog\/turn-turn-instructions-gpx-tracks-everything-never-wanted-know\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/scenicapp.space\/blog\/"},{"@type":"ListItem","position":2,"name":"Turn by turn navigation for GPX tracks\u2026 everything you NEVER wanted to know."}]},{"@type":"Person","@id":"https:\/\/scenicapp.space\/blog\/#\/schema\/person\/cbc1bdcf1026075c6c15eabafa1a1f94","name":"Guido","image":{"@type":"ImageObject","@id":"https:\/\/scenicapp.space\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/scenicapp.space\/blog\/wp-content\/uploads\/guido.png","contentUrl":"https:\/\/scenicapp.space\/blog\/wp-content\/uploads\/guido.png","caption":"Guido"},"description":"Independent Developer of ScenicApp","sameAs":["http:\/\/www.scenicapp.space","http:\/\/www.facebook.com\/motomappers","https:\/\/twitter.com\/@GuidoVanEijsden"],"url":"https:\/\/scenicapp.space\/blog\/author\/guidomm\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/posts\/782"}],"collection":[{"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/comments?post=782"}],"version-history":[{"count":30,"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/posts\/782\/revisions"}],"predecessor-version":[{"id":812,"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/posts\/782\/revisions\/812"}],"wp:attachment":[{"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/media?parent=782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/categories?post=782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scenicapp.space\/blog\/wp-json\/wp\/v2\/tags?post=782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}