[Editor's note: Continuing to work thru a backlog of noteable but past news... I like how this API defines a placename's location in a bounding box instead of a centroid. Wish it were both, but the bounding box seems more relevant (as a center point can be extracted, and you get the benefit of scale).]
Republished from GeoBloggers.com. Posted on May 12, 2008 by Reverend Dan Catt
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…
- Find the WOEID of a specific place
- Obtain a range of WOEIDs that match a given place, ordered by the most likely
… 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 …
- Resolve a WOEID to a place
- Find the parent of a given WOEID (and return a detailed record)
- To obtain a list of geographies that neighbor a specific WOEID
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 …
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 …
… 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 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]
Yahoo! today [in May] released a developer preview of its Yahoo! Internet Location Platform, a collection of in-depth geo-location based APIs. We expect to see location be more smartly used in many applications around the web thanks to this platform.
The gist of what’s being enabled is this: applications can provide the name of one location and then the Yahoo! APIs 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 today.
A lot of Ground Covered
Yahoo! explains the breadth and depth of location data it now offers thusly: “The [Platform] contains about six million places. Coverage varies from country-to-country but globally includes several hundred thousand unique administrative areas with half a million variant names; several thousand historical administrative areas; over two million unique settlements and suburbs, and two-and-a-half million unique postcode points covering about 150 countries, plus a significant number of points of interest, Colloquial Regions, Area Codes, Time Zones, and Islands.”
Geolocation is Hot Everywhere
Geolocation is hot, a number of new projects are underway to leverage increasingly sophisticated geographic knowledge to deliver value to end users. See our coverage of Brightkite and of Yahoo!’s own excellent FireEagle, for example.
Flickr developer Catt explains, for example, that Flickr could use the new APIs to offer images of nearby photos on several different levels, with accuracy as granular as Flickr is able to output.
There are a lot of interesting possibilities, not just for mapping but for services that are map aware. What would you like to see turned geo-smart? We’re excited to see what developers come up with. We probably won’t have to wait for long, either, since the Platform was released the day before O’Reilly’s Where 2.0 conference begins in Burlingame, California. Keep your eyes peeled for location savvy apps this week!