views:

107

answers:

1

Our users can enter their location into a free-form text field, like "Austin TX", or even "The Motor City". How can I take this information and turn it into a canonical name? For example, "The Motor City" would be Detroit, MI. They might even enter a zipcode or an address.

I'm planning on storing the place name, or the lat/long, or the unique id code for their location in the database. Then I can determine proximity. Is there a geo lookup api I can use for this?

A: 

Yahoo has a nice open API for dealing with this kind of thing, WOEID's (Where on earth); query the WOE DB for your freeform string, it'll give you back a WOEID, then Query the WOEID for whatever actual data you want to store. http://developer.yahoo.com/geo/geoplanet/guide/concepts.html

Andrew Bolster
In particular, it's their Placemaker API that handles conversions of free-form text into standard geographic concepts. (I think I've heard "The Motor City" used as an example, but I can't verify that offhand.) http://developer.yahoo.com/geo/placemaker/
npdoty
You're correct, and the motor city commect is from the Open Hack NYC conference http://developer.yahoo.net/blogs/theater/archives/2010/03/think_place_not_space.html
Andrew Bolster