Adding a world globe and location information to your site with YQL
Sunday, August 1st, 2010 at 1:34 pmWhilst looking around the open tables in YQL I found a table with earthquake information released by the United States Geological Survey. One thing the RSS feeds returned from that service had was quite a cool picture of Earth with the location as a star:

Looking at the source I realised that the image URL has a certain logic to it:
http://earthquake.usgs.gov/images/globes/50_40.jpg
The first number is the latitude, the second the longitude of the location. Each of them need to be multiples of 5 to result in an image. Try it out by changing the values.
Using this, I put together an open YQL table to render some HTML that shows a the globe image and the information the Yahoo GeoPlanet web service has available about that location.
You can use the table with the following YQL statement:
markupselect * from geo.globeimage where place="sfo" and type="data" and location="true"
Open this in the console here or see the results as XML.
The different parameters are:
place- The geographical location, like SFO for San Francisco Airport or London, UK for London, England
type- the type of the image. If you provide
dataas the parameter the image gets returned as inline data. This renders the badge much faster as the image doesn’t need to get loaded from the USGS server. location- A Boolean if want to show the list of location information or not
The above statement would render the following HTML:

- Name: San Francisco International Airport
- Placetype: Airport
- Country: United States
- Latitude: 37.614761
- Longitude: -122.391876
- WOEID: 12521721