4

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 Answers1

0

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.

Dogweather
  • 15,512
  • 17
  • 62
  • 81
  • 3
    Ok, but what kind of data do these databases offer? How can I calculate the distances with them? – Marcelo Paulon Jan 05 '14 at 07:32
  • "Boundaries, roads, address information, water features, and more." http://www.census.gov/geo/maps-data/data/tiger.html The files give every city block with long/lat coordinates I believe. – Dogweather Jan 05 '14 at 08:53
  • Oh whoops - I saw you're not talking about the U.S. Try checking what your federal government offers. They'll have a similar service. – Dogweather Jan 05 '14 at 08:53