GeoRSS4rb

GeoRSS4rb is an addon to the FeedTools library that aims at making GeoRSS information in a feed easily accessible for users of that library. It currently supports all the dialects (W3CGeo, Simple, GML) detailed in the GeoRSS specification version 1, including all the geometry types.

Installing

Just type under a command line: gem install georss4rb And the last version will be automatically downloaded and installed, along with the latest version of FeedTools, if you don't already have it, as well as GeoReuby (which is used for the actual GeoRSS parsing).

Operations

Now you have a location method on FeedTools::Feed and FeedTools::Item objects, that will return either nil, if no location exists, or an object of a subclass of GeoRuby::SimpleFeatures::Geometry or of GeoRuby::SimpleFeatures::Envelope, if a location exists. The subclass can be one of four types:

  • Point: With 2 properties, lat and lon

  • LineString: Behaves like an array of points

  • Polygon: Behaves like an array of lines (although the GeoRss spec version 1 allows only the exterior ring to be defined)

Here is an example of usage: feed = FeedTools::Feed.open('example.org/georss') feed.title #=>MegaCool GeoRSS feed feed.location #=><GeoRss4rb::Box …> feed.items.first.location #=><GeoRss4rb::Point …> The location of the entire feed could be a bounding of the location of the items. Then each item can have a location item, here a point. Note that the specific GeoRSS dialect used does not make any difference in the object returned.

It is also possible to retrieve the GeoRss tags (such as radius or featuretypetag, if present : Use the georss_tags property on either a Feed or FeedItem object. It will return an instance of GeoRuby::SimpleFeatures::GeoRssTags.

Changes since last version

  • Switch to using the GeoRSS parsing features of GeoRuby

TODO

  • Add support for other RSS parsing libraries

License

GeoRSS4rb is released under the MIT license.

Support

Any questions, enhancement proposals, bug notifications or corrections can be sent to [email protected].