Calculate driving distance locally, without Google Maps API

1.6k views Asked by At

I need to calculate a lot of driving distances, because I am running a genetic algorithm that calculates the best route given some latitude and longitude coordinates. Currently, it is using the Haversine formula, but it is not sufficient to produce accurate "best routes". I can't use Google Maps directions API/any external API because of performance and usage limits (I estimated about 900k distance calculations per day for my current list of latlng points). Is there any database containing "road coordinates/addresses" that I could get/buy so that I could calculate it locally, as Google servers do? Currently, I only need to calculate these distances in Rio de Janeiro. Would it be too hard to implement it?

1

There are 1 answers

3
Dogweather On

I've used the USGS Tiger/Line data to calculate routes and distances in Manhattan. I think these could be a great start. These files aren't as up-to-date as Google, but if you need that, there are for-pay databases available.