GeoRSS Parser

The javaxt-rss library can be used to parse location information published in standard Atom and RSS feeds. Location information can be expressed as points, lines, polygons, etc. and can be encoded using GeoRSS "where" tags or W3C "geo" tags.

Current Features

  • Supports W3C Basic Geometries
  • Supports GeoRSS Simple Geometries
    - georss:point
    - georss:line
    - georss:polygon
    - georss:box
  • Supports Common GML Geometries
    - gml:Point
    - gml:LineString
    - gml:Polygon
    - gml:Envelope
    - gml:box *
    - gml:MultiPoint *
    - gml:MultiLineString *
    - gml:MultiPolygon *
    * Not currently part of the GeoRSS Standard

Known Issues

  • GeoRSS Simple Geometries:
    - Does not support circles or elevation
  • GML Geometries with javaxt-gis:
    - Does not support coordinate triples
    - Does not handle the dimension or decimal attributes
    - Does not properly handle Polygons with inner polygons
    - Does not handle all GML Geometries
  • GML Geometries with JTS:
    - GML Boxes and Envelopes are improperly cast to
    com.vividsolutions.jts.geom.Geometry

Basic Usage

To parse location information with javaxt-rss, you'll need a copy of javaxt-gis or JTS somewhere in your class path. This can be as as simple as dropping the "jts-1.11.jar" or "javaxt-gis.jar" in the same directory as your "javaxt-rss.jar" file. If a suitable library is found, you can serialize the location information into a "Geometry" object with the getLocation() method. Here's a simple example:

      //Download a GeoRSS Feed and serialize it to an org.w3c.dom.Document. Note that in this 
      //example we are using the javaxt-core library but you can use whatever you want.
        String url = "http://www.kartographia.com/GeoRSS/examples/Atom.xml";
        org.w3c.dom.Document xml = new javaxt.http.Request(url).getResponse().getXML();


      //Once we have an XML DOM Document, instantiate the RSS parser and loop through  
      //individual elements in a feed.
        javaxt.rss.Feed[] feed = new javaxt.rss.Parser(xml).getFeeds();
        for (javaxt.rss.Item item : feed[0].getItems()){
            System.out.println("Title:\t" + item.getTitle());
            System.out.println("Date:\t" + item.getDate());
            System.out.println("Link:\t" + item.getLink());
            System.out.println("Location:\t" + item.getLocation());
        }    

Sample Feeds

Revision History

Version 0.1 (03/09/2007) Initial Release
Version 0.2 (03/13/2007) Critical Bug Fix: Failed to extract GeoRSS 'Simple' Geometries from RSS
Version 1.0 (11/16/2009) Refactored GeoRSS Parser into the javaxt-rss library
Version 1.1 (12/30/2011) Removed dependencies on javaxt-core and javaxt-gis