When we launched Yahoo! GeoPlanet two years ago, it was among the first web services to be supported by YQL, our web service that simplifies the way developers access and shape data available on the Internet. Earlier this year we added several new collections and resources to the web service, including GeoPlanet Concordance, which allows you to use place identifiers used by third-party data providers such as the FAA (airport codes), Geonames, and Wikipedia. We recently added YQL tables for these new features, along with documentation, to allow YQL developers to create even better location-based applications. Using YQL tables for Yahoo! GeoPlanet, a developer can get information about named places around the world and connect that information with other data in a single query. For example, you can get a list of countries in the world using the query:
select * from geo.countries
If you prefer to work in a different language, you simply add a where clause to the query:
select * from geo.countries where lang=it
If you are only interested in countries on a specific continent, theres a selection field for that , too:
select * from geo.countries where lang=it" and place=Europe
If you want just the ISO 3166-1 country codes and names for the countries above, theres a query for that:
select country from geo.countries where lang="it" and place="Europe" and view="long"
One of the great features in YQL is the ability to perform subselects — joining two selects in a query. For example, you can find the WOEID for a place and then find all photos in Flickr tagged for that WOEID:
select * from flickr.photos.search where woe_id in (select woeid from geo.places where text="San Francisco, CA")
Full documentation on the YQL tables for Yahoo! GeoPlanet may be found in the GeoPlanet User Guide. We will continue to add YQL tables as GeoPlanet evolves. We welcome your feedback on GeoPlanet and related YQL tables on the YDN Forum for GeoPlanet.