Geocoding and driving time APIs?
October 20, 2006 9:29 AM   RSS feed for this thread Subscribe

Geocoding and finding driving time between geocoded addresses: best free APIs?

I'll have several thousand addresses in a database. For each address, I want to geocode it, that is, find its latitude and longitude, and put that back into the database.

For all addresses within n statute miles of another address, I'll want to calculate approximate driving time between those addresses. Figuring n to be less than 5, that's still quite a few driving time lookups. I may or may not want to actually get driving directions.

I know how to calculate distance between two lat/lon pairs, so I don't need an algorithm.

What I do need is to figure out the best free APIs to geocode and calculate driving time.

Google Maps, the perl module Geo::Coder::US,, MapQuest? What should I use?

This is going to have to be quick and dirty, a very time sensitive, so my preferred API langauges would be what I'm most conformable coding in. In order of most preferred to least preferred, that's probably: C++, Java, Javascript. I can get around in Perl and figure out PHP.

Best case might be to get the Geo::Coder::US database into SQL, but that may be asking too much.
posted by orthogonality to computers & internet (5 comments total)
Sub question: apparently Perl CPAN module Geo::Coder::US::Import will build a gecoding (Berkeley) database from US Census TIGER data. Can anyone tell me what the latest TIGER files are, and which to use, to create a database for some arbitrary US state? Thanks.
posted by orthogonality at 9:43 AM on October 20, 2006


This program from the google programming contest is in Python, but might be helpful anyway. In any case, the readme has a bunch of information about grabbing TIGER data.
posted by inkyz at 10:24 AM on October 20, 2006


I'm pretty sure you're not going to find a free API for the driving time component of the question that allows bulk queries like you describe. You could certainly script and scrape Google Maps requests to get that, and it looks like the MapQuest API allows you to get route information, but you'd want to read their terms of service carefully before doing that. I'll be happy if someone proves me wrong, though. I'd love to have a good, free, open driving directions API to use.

You could certainly write something to do route finding based on TIGER data, but I doubt you could do it in the time scale it sounds like you want. I have a friend who's been writing something like that, on and off, for the last year.

Alternately, use the LA driving time approximation method: all driving times are approximately 30 minutes.
posted by hades at 10:50 AM on October 20, 2006


What hades said: the code to do this stuff is hard to get right and you really need a high quality dataset to properly do driving directions. Even if you found a free solution I doubt you'd get passable results. These problems are hard.

(Disclaimer: I work for a company that does exactly all the stuff you need, and more, with APIs, but you gotta pay).
posted by chuma at 11:51 AM on October 20, 2006


I've had good experience with the Ultimate Geocoder class in PHP. It keeps checking different services until one returns a result. But I agree with hades that you probably won't find a free API for driving directions or time estimates.
posted by scottreynen at 12:01 PM on October 20, 2006


« Older What bars have good pub quizze...   |   Is there any way to clean a me... Newer »
This thread is closed to new comments.