Yahoo Woe (Where On Earth, that is) IDs.

Roll up, roll up, roll up, get your WoE IDs here …

http://developer.yahoo.com/geo/

… a jolly nice step in the right direction.

Yahoo have opened up their geo database (which is pretty good btw) which is far more awesome than I’m going to make it sound in this blog post. I already did a little bit back here. But a quick call out to these two functions that’ll try and find you WoE IDs based on string input…

… the first API call gives, 36240 as the value for Stoke on Trent in the UK, my old hometown. With that WoeID I can plug it back into these other API calls to get various useful information back …

We use WoE IDs over at Flickr, again you can read a little more about that near the end my terribly long previous blog posts about twitter, APIs and such like. A quick recap is that we have these WoE related APIs …

The ones that probably compliments the APIs over at developer.yahoo.com/geo are flickr.places.findByLatLon, which will turn a Lat/Long into what Flickr believes is there, more on this in a second.

And flickr.places.resolvePlaceId, if you plug the value of 36240 into the API explorer there you’ll get this xml back …

<rsp stat="ok">
	<location name="Stoke on Trent" woeid="36240" place_id="gEXCB1iaB571gw" place_url="/United+Kingdom/England/Stoke+on+Trent">
		<locality place_id="gEXCB1iaB571gw" woeid="36240">Stoke on Trent</locality>
		<county place_id="B_K1Z7iYA5qfCIiHaw" woeid="12602189">Staffordshire</county>
		<region place_id="pn4MsiGbBZlXeplyXg" woeid="24554868">England</region>
		<country place_id="DevLebebApj4RVbtaQ" woeid="23424975">United Kingdom</country>
	</location>
</rsp>

Where you can see the same woeid, the URL to get to the Places page for Stoke on Trent, and the parent hierarchy flickr uses.

You can also plug the woeid into the flickr.photos.search to get photos back for just that area. A quick example of why that is useful is California, there’s no way you’d want to find photos for California using the bounding box, as it covers a couple of other states …

california.jpg

… but instead you can use the woeID for California (2347563) which deals with all the bends and kinks of CA. You can also throw that ID into the Places URL, like this … http://www.flickr.com/places/2347563, although you’ll probably want to pass that through flickr.places.resolvePlaceId first if you want a pretty URL.

Differences between Yahoo geo API stuff and Flickr

Over at Flickr, we only use specific ‘levels’ of geo information, such as city, region, state, country, while the APIs over at Yahoo will spit out far more levels in-between the ones Flickr uses, as well as deeper down to neighborhood levels, which Flickr doesn’t do (yet).

Just because you get a WoeID back from Yahoo, doesn’t mean we’ll have photos for that specific area, we’ll probably bounce you up to the next largest places we deal with. So our parent hierarchy will have less steps in it that the ones you get back from Yahoo’s geo stuff. It also means our find by lat/long will only go down to town/city level and not precise neighborhood level.

We also don’t do photos or Places pages for Landmark WoeIDs, taking their example of Sydney Opera House which gives you an ID of 28717584 and throwing that at Places will give you no photos (maybe one day), although you can bounce up to Sydney.

Anyway, it goes beyond photos at Flickr, it’s just a really useful way that you, a developer can key off an ID for a place, that someone else, somewhere else can also key off.

If you use the ID 2347563 for California, and they use the ID 2347563 for California. And one, or both of you, publish your information with that ID, then you, they, or other people know that you’re both talking about the same place and match that data up.

Which is nice.

[Update 1: If you're coming here from the CNET news article my talk isn't actually about the location platform, its about Flickr photos and location :)]

[Update 2: For more official stuff about the Location Platform, you should probably see the Yahoo Local & Maps Blog post Abstracting Spatial Relationships with the Yahoo! Internet Location Platform where they use phrases such as "unambiguously", "permanent" and "language-neutral", and sum everything up far better than I]

[Update 3: and if you haven't yet checked it out, I still think its worth reading my blog post "Twitter API updates, FireEagle and new Flickr API fun" as an example of what to do with woe IDs]

17 Responses

  1. Are there any tricky rights issues involved in using a WoeID as an identifier in a third party system? Is it sensible to build something exciting (but commercial) around those IDs without fear of the lawyers coming knocking in a few years time?

  2. As I understand it, it’s open, as in, designed specifically so 3rd parties can use it for building stuff on. And the IDs are good for all time, taking into account countries changing name and so on.

    But I believe there’s going to be some talk about it at Where 2.0 (not my talk) where such things will be discussed, so-on and so forth. So I’d wait a couple of days to double check what I just said.

  3. Oh, Yahoo! Local says they’re “permanent” which I guess answers that.

  4. Simon, not an official answer either, but the public WOE API is all Yahoo-owned data, and most of the weird TOS you run across are due to licensing terms with 3rd parties. WhereOnEarth was a 2005 acquisition, so there are no 3rd-party data issues here. As far as I know the only restriction is the 50k daily query limit.

  5. [...] Catt has some details on his blog about WOEID and how Yahoo! is using [...]

  6. It seems foolish to lock users into a proprietary identification scheme and API when I can download and use geonames.org database with terms of use as short as “CC-BY”, or use their API instead. What advantage(s) does Yahoo’s platform offer over the one at geonames.org?

  7. [...] are already being used in Flickr and its API, as Rev Dan Catt documents. Presumably, the Location Platform API will be used throughout Yahoo!’s other services (such [...]

  8. n[ate]vw: I don’t think you have to use Yahoo’s platform over geonames, and to some degrees they compliment each other. If you have an object (photo, film, blog post, spime, etc.) that you want place at a location, you can use the id from geonames, but you can also add the WoeID as an extra piece of information. Or visa-versa. Other people can then match up your ‘objects’ with their ‘objects’ or queries on whichever you are offering.

    You don’t have to exclusively use just one. You can either use both, or pick the one that you think is most suitable to your needs.

  9. [...] will report neighboring and “parent” locations. Flickr developer and map lover Dan Catt articulates the potential power of the API very well in a blog post [...]

  10. I was curious as to why Yahoo didn’t choose to use the FIPS code or at least cross reference a FIPS code if available. Paleo geographers (as I am now referred) to have been using this coding system for years and it is expansive enough to be extendable. Creating a UNIQUE place ID for UNIQUE joins isn’t anything new.

    Chris

  11. [...] up their geo database which is pretty good btw which is far more awesome than I??m going to make ithttp://geobloggers.com/archives/2008/05/12/yahoo-woe-where-on-earth-that-is-ids/Malakoff Acquisition URL.AX, 00841104, 20080512 Huntleys’ Stock of the Week via Yahoo!7 [...]

  12. Hi! I am a Japanese. Though I looked for English study in various ways, I commented because contents were interesting. I was able to enjoy it very much. In addition, I come to look. Please keep it for us. Thank you!

  13. [...] Yahoo Woe (Where On Earth, that is) IDs but imagine it talks about going down to the next level will do the [...]

  14. [...] Republished from GeoBloggers.com. Posted on May 12, 2008 by Reverend Dan Catt [...]

  15. [...] “What is a shapefile?” you may ask. Its a file containing shapes mathematically generated by the thousands of Flickr geotagged photos of particular neighborhoods, countries, and continents. The data can also be seen as reverse-engineered fuzzy maps created by user generated longitude and latitude coordinates that are then demarcated by Where-On-Earth IDs. [...]

  16. [...] about a more sophisticated method for trying to solve the problem, by using the Flickr API and WOEs to let residents determine their own [...]

Leave a Reply