A Proposal - GeoRSS & KML

There has recently been a lot of discussion around KML becoming part of the OGC and the future of GeoRSS and KML. Will GeoRSS use KML payloads, or vice versa? Will one just subsume the other? After speaking with a bunch of people at Where, and also thinking about various announcements and talks given by Google-ites, Geo-ers, and standards makers, I'm proposing the following practice for using GeoRSS and KML together along with other formats.

In the talk announcing KML submission to OGC, the phrase "KML is HTML for the geospatial web" was used. I think this is a perfectly apt analogy. To complete the analogy, (taking you back to your SAT days)

HTML : RSS :: KML : GeoRSS

The purpose of the following examples is to illustrate the use of GeoRSS to syndicate KML content, similar to RSS support in HTML. GeoRSS merely adds a geographic component to the common RSS that syndicates web content. KML similarly offers a geospatial alternative representation of HTML content.

Syndication


Therefore, as appropriate, GeoRSS should be used based on existing usages of RSS. This means providing a rel="alternate" link in both HTML and KML files. Conversely, an Atom or RSS feed requires use of a 'link' element to reference the originating content of the syndication. A rel="alternate" can then be used in a GeoRSS feed to reference the KML version of that content.

Within a GeoRSS file, the entire feed, or channel, can link to the content in type="text/html" and type="application/vnd.google-earth.kml+xml". Within a single entry, the GeoRSS feed can then link to the specific anchor, or element, within the original HTML or KML content using an anchor in the href.

kml_georss.rss

xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>KML GeoRSS Exampletitle>
<link href="http://example.org/"/>
<updated>2007-06-04T12:34:02Zupdated>
<author>
<name>Andrew Turnername>
author>
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6id>
<link rel="alternate" type="test/html"
href="http://example.org/"/>
<link rel="alternate" type="application/vnd.google-earth.kml+xml"
href="http://example.org/kml_georss.kml"/>

<entry>
<title>This is my first articletitle>
<link href="http://example.org/2007/06/04/article"/>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6aid>
<updated>2003-12-13T18:30:02Zupdated>
<summary>
KML is the HTML of the geospatial web, used to visualize content, and GeoRSS is the syndication of that content.

While you're here, make sure to check out my <a href="http://example.org/myspots.kml#favoritepark" type="application/vnd.google-earth.kml+xml kml">favorite parka>.
summary>
<link rel="alternate" type="application/vnd.google-earth.kml+xml"
href="http://example.org/kml_georss.kml#article1"/>
entry>
feed>


Documentation


Within an HTML file, the element can contain alternate links to the KML representation as well as the GeoRSS syndication. Similarly, KML 2.2 can contain an alternate representation back to the original HTML content and GeoRSS syndication of the geospatial information. By using these links, a resource can offer multiple formats as appropriate, syndication for alerting users of updates to the content, or visualization for a richer geospatial view.

For a specific KML Placemark, an can be used to link to the original HTML element using the anchor support in the href. Conversely, the HTML element, similar to a GeoRSS item, can use an element to link to the specific KML Placemark representation. This similarly allows for the documentation element to reference the richer visualization of the feature. Clicking this link would either launch a KML viewer, or the original HTML renderer could render the KML element inline, within the browser.

Notice that by using the type attribute in the we can link to other KML elements, similar to an HTML document linking to elements in other HTML documents.

Visualization

kml_georss.kml

xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>kml_georss.kmlname>
<atom:link type="text/html"
href="http://example.com" title="My Page">atom:link>
<atom:link rel="alternate" type="application/rss+xml"
href="http://example.com/kml_georss.rss" title="GeoRSS feed for My Page">atom:link>
<Placemark id="article1">
<name>This is my first articlename>
<atom:author>
<atom:name>Andrew Turneratom:name>
atom:author>
<atom:link href="http://example.org/kml_georss.html#article1">atom:link>
<description>
KML is the HTML of the geospatial web, used to visualize content, and GeoRSS is the syndication of that content.

While you're here, make sure to check out my <a href="http://example.org/myspots.kml#favoritepark" type="application/vnd.google-earth.kml+xml">favorite parka>.
description>
<Point>
<coordinates>-122.370533,37.823842,0coordinates>
Point>
Placemark>
Document>
kml>


Together, these suggestions allow for parallel use of KML and HTML for content, and GeoRSS for syndication (notification of updates) to that content. It keeps the GeoRSS as a pure markup of the new information, and keeps styling information in HTML and KML.

Here is a spiffy diagram to help illustrate linking the documents and articles together:

GeoRSS, KML, HTML interoperability

A last consideration about linking HTML content and KML content. Both formats are merely markups for storing and rendering information and not bound to a specific renderer (e.g. Firefox or GoogleEarth). However, it is still beneficial to link to a richer geospatial markup from an HTML file. elements can optionally utilize the type attribute to specify the link follows to a KML file. It should explicitly noted that opening a link to a KML type should not necessarily open in GoogleEarth. Again, KML is just a richer geospatial markup of information.

For example, if a user is viewing a location from a GeoRSS file loaded in a 2D map representation, and link in the content points to a KML type, clicking this link should first open the location in the same 2D map representation. If the link is clicked in an HTML file, the appropriate MIME-type handler should be invoked. This is similar to a user clicking a link in an HTML document and opening the link in the HTML renderer.

Depending on the 2D map rendered, an optional "view in 3D" link could be offered to open the Placemark in GoogleEarth or other KML renderer.

OpenSearch


This proposal is just a suggestion, and doesn't require a change to any of the included formats. In fact, it is just a recommendation for a common usage of these formats to provide for better user experience and linking together your content. Additionally, my
previous discussion on OpenSearch Geo fits perfectly with this as you can specify search mechanism for the same content-types. So if you just want the recent changes, request the RSS. Then you could use those results (page) to query specific KML rich placemarks for visualizing.

About this article

written on
posted in GeoRSSNeogeographyKML Back to Top

About the Author

Andrew Turner is an advocate of open standards and open data. He is actively involved in many organizations developing and supporting open standards, including OpenStreetMap, Open Geospatial Consortium, Open Web Foundation, OSGeo, and the World Wide Web Consortium. He co-founded CrisisCommons, a community of volunteers that, in coordination with government agencies and disaster response groups, build technology tools to help people in need during and after a crisis such as an earthquake, tsunami, tornado, hurricane, flood, or wildfire.