https://medium.com/@Meyer.Nils/how-to-automate-distance-and-travel-time-calculations-using-r-and-osrm-3aa8a2ecebc6
·
6 min read
·
Apr 19, 2020
Photo taken by Nils Meyer
From my own experience in Data Science, I have been observing massive interest in making use of spatial data (geographical data). Whether it is a visualization of a geographical shape in combination with certain (performance) indicators or simply calculations, based on spatial informations. The reason behind that is quite obvious, I guess: There might be very few things that communicate information more intuitively than a map, spatial data is a very informative ressource in many business cases, and besides that, any dashboard that visualizes data, is beautified by a map.
However, as it is the case with many topics in data science, when you are a beginner, you are often unable to see the wood for the trees. Some guiding input, when you are confronted with a certain class of problems, is always helpful. That is why i wrote this article. To give some guiding input in automating the calculation of distance and travel time, which is a relevant foundation for further analysis in many practical scenarios. Based on data from the Open Street Map Project (OSM), the Open Street Routing Machine and the language R, I will show how to setup a basic, but nevertheless complete, technology-infrastructure to automate the task of calculating distance and travel time.
Some background about OSM and OSRM
A Wiki all about the OSM-Project: [https://wiki.openstreetmap.org/wiki/Main_Page](http://In order to keep this part rather short, instead of talking about all the details, i just give some helpful links about OSM and OSRM, and will focus more on solving the problem itself. A Wiki all about the OSM-Project: https://wiki.openstreetmap.org/wiki/Main_Page A place where you can download relevant data from the OSM-Project: https://download.geofabrik.de/ The Github-Place for the OSRM-Service and some documention: https://github.com/Project-OSRM/osrm-backend/wiki)
A place where you can download relevant data from the OSM-Project: [https://download.geofabrik.de/](http://In order to keep this part rather short, instead of talking about all the details, i just give some helpful links about OSM and OSRM, and will focus more on solving the problem itself. A Wiki all about the OSM-Project: https://wiki.openstreetmap.org/wiki/Main_Page A place where you can download relevant data from the OSM-Project: https://download.geofabrik.de/ The Github-Place for the OSRM-Service and some documention: https://github.com/Project-OSRM/osrm-backend/wiki)
The Github-Place for the OSRM-Service and some documention: https://github.com/Project-OSRM/osrm-backend/wiki
Example Use Cases
Imagine you want to decide, where to build your next store (e.g. a supermarket) and obviously it is a highly relevant factor, how potential customer can reach a place. With the method that I am going to introduce, you will be able, to quickly ran simulations for different investment options, whether you presume that your customer will reach your store by car, by bicycle or simply by feet. And eventually find the optimal option in terms of reachability.