Reverse Geocoding to woeids

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>

Tags: , , , ,

12 Responses to “Reverse Geocoding to woeids”

  1. Ivan says:

    geomojo.org – da best. Keep it going!
    Ivan

  2. forex robot says:

    good article as usual!

  3. Krasotulya says:

    Dear Author geomojo.org !
    Absolutely with you it agree. In it something is also idea good, I support.

  4. 5pancakes says:

    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

  5. geomojo1 says:

    Sure no problems.

  6. I think that that was really interesting. Good post!

  7. gimenete says:

    Is there any way to fetch Countries instead of Zip Codes? I know that with GeoPlanet if you have the woeid you can get the hierarchy. But are you planning to add another parameter to specify the returning PlaceType?

  8. geomojo1 says:

    The current API does not support this. But you should be able to get the country using the belongto relationship.
    http://where.yahooapis.com/v1/place/WOEID/belongtos.type(country)?appid=YOURAPPID

  9. khollis says:

    Is this web service free for anyone to use, or are you charging a fee for lookups over time? I’d like to use this in an application I’m building, and this is the only place I know of that provides this service.

  10. geomojo1 says:

    No it is free and will always be ;-)

  11. mondo says:

    I want to cache this lookup so it doesn’t have to make an external call. Do you happen to have this in database/csv? Im my personal instance i want to convert zip to woeid, but I’m fine with lat/long too.

  12. geomojo1 says:

    Sorry I don’t keep any logs. If you want to do a lookup for zip to woeid you might be interested in using geoplanet http://developer.yahoo.com/geo/geoplanet/guide/api-reference.html#api-places.
    Here is a sample call to get woeid for the WC2H 8AD zip in london:

    http://where.yahooapis.com/v1/places$and(.q(WC2H 8AD),.type(11))?appid=YOURAPPID

Leave a Reply

Spam Protection by WP-SpamFree