Posts Tagged ‘Reverse Geocoding’

Reverse Geocoding to woeids

Monday, November 23rd, 2009

With twitter providing trend search base on woeids. I started to look at what geotagging twitter provided for its tweets. I soon noticed that there were only providing long/lats of the user location. It would be useful to have the woeid associated to these long/lats. This is why I implemented a simple service returns geo-informations associated to the long/lats.

The services is located at http://www.geomojo.org/cgi-bin/reversegeocoder.cgi and only take 3 parameter one of which is Optional.

  • long: The longitude of the point you want to reverse geocode.
  • lat  : The latitude of the point you want to reverse geocode.
  • format : Optional parameter used to indicate which format you want to be returned by the service. The supported formats are JSON and XML. XML being the default format provided.

To reverse geocode I use the functionality provided by Placemaker. Placemaker handles micro-formats and the returns the location associated to the long/lats in the micro-format. My services just uses this functionality by wrapping the long/lats given in a micro format and submitting it to Placemaker. At the moment the smallest entity returned by the service are zips.

Here is the output of the service for a given long/lat:

http://www.geomojo.org/cgi-bin/reversegeocoder.cgi?long=-97.470929&lat=37.510042

<place>
<woeid>12787085</woeid>
<name>67026</name>
<type>Zip Code</type>
</place>