Google Maps Bulk Geocoder

I’ve been playing with the Google Maps Javascript API lately. One of the results of this is a simple utility to geocode addresses in a delimited text file. It is based on the geocoding example in the Google API playground.

It’s pretty straightforward to use:

  • Paste the data to be geocoded in the large text field to the right. For instance, using [this](http://code.google.com/p/gmaps-samples/source/browse/trunk/articles-csvtokml/google-addresses.csv) sample data. That sample data file has the following field definitions: Office,Address1,Address2,Address3,City,State,Zip,Phone,Fax
  • Enter the field separator used in your data. In the example data above, a comma is used as a field separator.
  • Select the fields and order of the fields to be used to form an address. Fieldnumbers start at 0, so in the example above the list of fields would be 1,2,3,4,5,6. Would, say, Address3 be a more logical field to start the address with, you can change the order as such: 3,1,2,4,5,6.
  • Hit the `Geocode this` button.

When you press Geocode this, the addresses will be posted to Google Maps, geocoded by Google and plotted on the map. At the same time three fields are appended to your data records: latitude and longitude for the given address and a result code. The result code will be 200 for a succesful lookup. A sample geocoded result line looks like this:

Headquarters,1600 Amphitheatre Parkway,,,Mountain View,CA,94043,650-253-0000,650-253-0001,37.4217335,-122.0841873,200

It might help to pan and zoom the map to the location where you expect your results to be before you press Geocode this, it helps Google to find more appropiate results.

Comments