O'Reilly logo

Yahoo! Pipes by Mark Pruett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

KML and GeoData

In May 2007, Yahoo! Added support for KML output (in addition to RSS and JSON formats). KML (Keyhole Markup Language) is an XML format for describing geographical data. Here's an example of KML data:

<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
 <name>Top 20 Earthquakes in Past Week</name>
 <description>USGS data for recent quake activities.</description>
 <Placemark>
  <name>M 6.5, Fiji region</name>
  <description>
   A magnitude 6.5 quake in the Fiji region.
  </description>
  <TimeStamp>
   <when>2007-05-06T14:11:52-07:00</when>
  </TimeStamp>
  <Point>
    <coordinates>−179.3328,−19.3892</coordinates>
  </Point>
</Placemark>
</Document>

If your Yahoo! Pipe contains geographical data, you can now publish this data in KML format. Even more exciting, the Yahoo! Pipes preview page now lets you preview the data on an interactive map. This means you can create your own map mashups without hosting them on your own server.

As an example, I've built a Pipe to plot recent large earthquakes. The U.S. Geological Survey (USGS) provides earthquake data on their web site, http://earthquake.usgs.gov/eqcenter/catalogs/. USGS makes data available in KML format, but it's compressed into something called KMZ format (actually this is just a zip-compressed file). These KMZ files can't be used as a Yahoo! Pipes data source, but luckily the USGS also provides data in RSS format.

Using the RSS data my Pipe reads a feed of all magnitude 2.5+ earthquakes in the past 7 days. This feed contains one item for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required