> root / 2008 / May / 12th

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


... 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>

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 ...


...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]

## Table of Contents: May

### More

### About

This is what used to be a blog, but is now an online diary/archive sort of thing. As I'm laying off the twitter a bit and currently reclaiming all my Flickr photos this is the main place to find me, (subscribing via RSS) should still work.

I also have a podcast, with more audio experiments on SoundCloud. A smaller "scrapblog" is over on tumblr. If you need to get hold of me email hello@revdancatt.com

### Blogroll

Other blogs I track, some on the offchance they start publishing again.