Search code examples
google-mapsstreet-addressqualified

Google Maps API: Can you explicitly qualify address parts


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?


Solution

  • 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.