I am looking to get an approximation of the travel distance and time between several locations.
Ideally, I want to be able to send in the GPS coordinates of the locations, use the data of OpenStreetMap, and get as an output a distance matrix with the given locations, all of this would be done offline on my AWS server. (Using PHP or C++ would be good)
I am really new to using OpenStreetMap. I have just downloaded the ile-de-france.osm.pbf, which is the map for a region of France.
I have no clue where to start. I am not even sure if it is simple to do it. Can anyone point me in the right direction? And If OpenStreetMap is not the best solution for getting a distance matrix offline, then what is?
For calculating traveling distances you have to install a router, too. Choose one of the available online routers (many of them can be installed locally and used offline, too) or offline routers. Good choices are OSRM, GraphHopper and gosmore.
OSRM has a distance matrix call, but it's currently limited to a certain quantity of locations. I've built a script to make large distance matrices with a local OSRM server (it's really simple to compile on Ubuntu). Here it is https://github.com/sabas/OSRMdistance I've computed square matrices of more than 300 locations...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With