The Google Geocoder API
Google allows web developers to create “mashup” mapping applications using programming API’s that connect to Google’s mapping servers. One of the APIs is for geocoding – finding the location of a place based on its name. For example: when you want to see a map of “Turners Creek, MD” you first have to geocode the place name to its latitude and longitude coordinates (39.342013,-75.996743).
Fun with the Google Geocoder API
I was investigating how the geocoder returns information when an address lookup fails, so I typed in “la la land, MD” (MD = Maryland), expecting the geocoder to fail, but to my great surprise it returned an actual location near Front Royal, MD (you can try this at the Google geocoder api demo page or at any number of Google maps mashups). For my international readers, when an American says someone is in “la la land” she is suggesting that the person is not grounded in reality, e.g. living in a fantasy land. For the fantasy location “la la land, MD“, the Google API return results indicate that the accuracy is at the “country” level so I would have expected to get the centroid of the US (Google puts this somewhere near Portland Oregon, which makes sense if you include all 50 states). Nor is the location the centroid of the State of Maryland which, by a quirk of geography and history, is located in Fairfax, Virginia. This leads me to wonder whether someone actually put “la la land, MD” in the database. “la la land, NY” also has a “country” level accuracy. It is located near Muttontown, New York on Long Island, just off Brookville Rd. If you drive by, take a picture and I will post it here.
Next I typed in “la la land, PA” and found that it actually returned a location with “street level” accuracy. Oops. Apologies to anyone who lives at “Farm Land Rd Way, Mifflinburg, PA 17844“! Surprisingly, the regular Google maps fails to geocode that location. It is possible that this could be a parsing error since “la land, pa” geocodes to an address of “Land Ln, Schnecksville, PA 18078, USA” and “la la land, CA” (California) is at “Garden Land Rd, Los Angeles, CA 90049“.
Google Maps API Geocoder uses Tiger Data?
For US addresses, the Google geocoder API, which is free for no more than 50,000 geocodes per day, behaves differently than the one on maps.google.com. In fact, it behaves a lot like geocoder.us, which uses free US Census Bureau tiger data. The problem with tiger data is that is not nearly as complete or accurate as the NavTeq mapping data that all of the major mapping services use. Here’s an example: Use the address “210 south bank, Landenberg, PA” and enter it into to maps.google.com, geocoder.us and this demo page (uses the Google map geocoding API). You will see that maps.geoogle.com finds the correct location but both geocoder.us and the Google geocoder API fail. Now type in “1600 Amphitheatre Pky, Mountain View, CA” and you will see that geocoder.us and the Google API both succeed.
It makes sense for Google to use tiger data for their API partners. After all, accurate geocoding data costs money and the users of the geocoding API aren’t paying anything. And unlike map images, I can think of no obvious way to sell advertising for geocodes.