Ticket #121 (defect)

Opened 1 year ago

GeoRSS support for feedparser 4.1

Status: new

Reported by: seang Assigned to: seang
Priority: minor Milestone:
Component: Data Stores and Sources Version:
Keywords: georss feedparser Cc:

Attached is a patch to feedparser 4.1 that adds support for simple GeoRSS (http://georss.org/simple) in feeds. The geospatial geometry of an entry is accessed via a "geometry" key, the value of which is a dict with "type" and "coordinates" items (following http://wiki.geojson.org/GeoJSON_draft_version_2).

Point example:

  <feed
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:georss="http://www.georss.org/georss"
    >
    <entry>
      <georss:point>36.9382 31.1732</georss:point>
    </entry>
  </feed>

yields:

  >>> entry['geometry']['type']
  'Point'
  >>> entry['geometry']['coordinates']
  (31.1732, 36.9382)

Feedparser coordinate tuples are always in (longitude, latitude) order. Users might specify an optional third elevation value, but almost never do. The default elevation is 0 meters above ground level (AGL).

Line example:

  <feed 
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:georss="http://www.georss.org/georss"
    >
    <entry>
      <georss:line>
        33.338611 52.566592 32.537546 52.527238 31.744196 52.409555
      </georss:line>
    </entry>
  </feed>

yields:

  >>> entry['geometry']['type']
  'LineString'
  >>> entry['geometry']['coordinates'][0]
  (52.566592, 33.338611)

Attachments

feedparser-georss-4.1.patch (4.8 kB) - added by seang on 07/31/07 08:54:23.

Change History

07/31/07 08:54:23: Modified by seang

  • attachment feedparser-georss-4.1.patch added.