views:

171

answers:

2

We're using the Google Maps API for an application to determine distance and driving directions for a set of addresses in a database. Overall, we're dealing with around a 1000 addresses and some have typos, abbreviations,... that are causing some problems with returning the proper address hit (lat/long).

For addresses that don't return a proper result, we are trying to drop parts of the address (i.e. just use Address and Zip, and not City, State). But we're finding that some of the results are waaaaay off (i.e. somewhere in Poland).

So, we're wondering if it's possible to qualify the address parts (i.e. address=1600 Pennsylvania Avenue&zipcode=49455) to avoid misinterpretation by Google maps. Anyone know if it's possible to do this?

+1  A: 

I think you're stuck with just sending the string to google and dealing with what you get back. One thing you can do is use GClientGeocoder.setViewport() to specify a bounding box where your results should show up and/or use GClientGeocoder.setBaseCountryCode() to specify that your results should be in a specific country.

Swingley
A: 

http://en.wikipedia.org/wiki/Garbage%5FIn,%5FGarbage%5FOut "GIGO" is the rule when it comes to addresses.

Rather than trying to clean the list yourself, there are plenty of mailing list companies that will cleanup your address list for a fee.

They will correct addresses, and identify bogus addresses. They will also run your list through the post office's Forwarding database. That will give you the current addresses for your older data.

People and businesses move constantly.

Added-- If you have good zip codes, you can use them instead of the city, state. Just use "10 main st, 10045" as your input to Google. But you need to know that your zip codes are correct. (A mailing list company will handle that for you.)

Larry K