{"id":1944,"date":"2016-07-02T21:54:51","date_gmt":"2016-07-02T20:54:51","guid":{"rendered":"http:\/\/www.jurecuhalev.com\/blog\/?p=1944"},"modified":"2016-07-02T21:54:51","modified_gmt":"2016-07-02T20:54:51","slug":"travel-time-distances-from-ljubljana-center","status":"publish","type":"post","link":"https:\/\/www.jurecuhalev.com\/blog\/travel-time-distances-from-ljubljana-center\/","title":{"rendered":"Travel Time distances from Ljubljana Center"},"content":{"rendered":"<p class=\"p1\"><a href=\"http:\/\/www.jurecuhalev.com\/ljubljana-isochrone\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1945 size-full\" src=\"https:\/\/www.jurecuhalev.com\/blog\/wp-content\/uploads\/2016\/07\/traveltime.gif\" alt=\"traveltime\" width=\"604\" height=\"448\" \/><\/a><\/p>\n<p class=\"p1\"><a href=\"http:\/\/www.jurecuhalev.com\/ljubljana-isochrone\/\">View the interactive map<\/a><\/p>\n<p class=\"p1\">My friends are looking to buy an affordable house around Ljubljana. But what are their options, if they want to choose based on commute time? I decided to build a tool to visualise their options.<\/p>\n<blockquote>\n<p class=\"p1\">An isochrone map (isochrone plan, isochrone diagram) in science and urban planning is a map showing areas related to isochrones between different points. An isochrone is defined as &#8220;a line drawn on a map connecting points at which something occurs or arrives at the same time&#8221; (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Isochrone_map\">https:\/\/en.wikipedia.org\/wiki\/Isochrone_map<\/a>)<\/p>\n<\/blockquote>\n<p class=\"p1\"><b>Methodology and Technology<\/b><\/p>\n<p class=\"p1\">I&#8217;ve generated\u00a0a grid of ~40.000 points in Slovenia and calculated travel time to it from a fixed point in Ljubljana Centre. Each point is displayed on a map with radius of\u00a0800 meters. It&#8217;s a tradeoff between number of points and realistic travel time with a car in a populated area.<\/p>\n<p class=\"p1\">For routing and time calculations, I used <a href=\"http:\/\/project-osrm.org\/\">Project OSRM<\/a>\u00a0with\u00a0OpenStreetMap database of Slovenia. A\u00a0Python script connected all of this together into a static dataset\u00a0for the the web site.<\/p>\n<p class=\"p1\"><b>Lessons learned<\/b><\/p>\n<p class=\"p1\">I first coded a prototype with\u00a0\u00a0Google Maps Directions API. It turns out that 2500 requests\/day isn&#8217;t enough to make such an application practical.<\/p>\n<p class=\"p1\">I\u00a0then found OSRM and it allowed me to host directions API directly on my computer. It&#8217;s also really fast. On a single i7 core, it can do about 40 requests\/second.\u00a0In practice is almost as\u00a0good as\u00a0commercial API&#8217;s. Based on my tests, the difference of results\u00a0is about +\/- 5 minutes.<\/p>\n<p class=\"p1\">What is missing is traffic data.\u00a0OSRM is returning travel time in optimal traffic conditions. While some of this data is openly available, I&#8217;m not sure how to incorporate it. It would also mean that the whole\u00a0visualisation would\u00a0need to display the time component too.<\/p>\n<p class=\"p1\"><b>What&#8217;s next<\/b><\/p>\n<p class=\"p1\">I&#8217;d like to build a similar version for public transportation &#8211; both inside Ljubljana and in the greater Ljubljana region.<\/p>\n<p class=\"p1\">It wouldn&#8217;t be too hard to make this map dynamic &#8211; so you could select your own starting point.<\/p>\n<p class=\"p1\">I&#8217;ve also discovered that\u00a0running your own directions API opens up a number of new possibilities. One of them would is potentially adding a layer of routing to Prevoz.org so we could calculate travel time and\u00a0also suggest rides that pass through your city.<\/p>\n<p class=\"p1\"><strong>Do you have any ideas?<\/strong><\/p>\n<p class=\"p1\">Let me know in the comments.<\/p>\n<p class=\"p1\">I now also have a newsletter\u00a0so you can\u00a0be notified when I release something new. <a href=\"http:\/\/eepurl.com\/bABbA1\">Subscribe to it now \ud83d\ude42<\/a>.<\/p>\n<p class=\"p1\">\n","protected":false},"excerpt":{"rendered":"<p>View the interactive map My friends are looking to buy an affordable house around Ljubljana. But what are their options, if they want to choose based on commute time? I decided to build a tool to visualise their options. An isochrone map (isochrone plan, isochrone diagram) in science and urban planning is a map showing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[359],"tags":[],"class_list":["post-1944","post","type-post","status-publish","format-standard","hentry","category-visualization"],"acf":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/1944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/comments?post=1944"}],"version-history":[{"count":7,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/1944\/revisions"}],"predecessor-version":[{"id":1952,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/posts\/1944\/revisions\/1952"}],"wp:attachment":[{"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/media?parent=1944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/categories?post=1944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jurecuhalev.com\/blog\/wp-json\/wp\/v2\/tags?post=1944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}