Skip to main content

GeoRSSFeed

This class extends the standard RSS 2.0 feed implementation to support GeoRSS geographic metadata. It automatically manages the necessary XML namespaces and provides methods to include spatial information in both the root feed and individual feed items.

Methods


rss_attributes()

@classmethod
def rss_attributes() - > dict

Retrieves the attributes for the RSS root element, including the GeoRSS namespace declaration.

Returns

TypeDescription
dictA dictionary of attribute names and values for the RSS element, including the xmlns:georss namespace.

add_item_elements()

@classmethod
def add_item_elements(
handler: xml.sax.saxutils.XMLGenerator,
item: dict
) - > null

Appends additional elements to an individual item in the feed, specifically adding GeoRSS geometry data.

Parameters

NameTypeDescription
handlerxml.sax.saxutils.XMLGeneratorThe XML handler instance used to generate the feed content.
itemdictA dictionary containing the data for a specific feed entry, including its geographic coordinates.

Returns

TypeDescription
null

add_root_elements()

@classmethod
def add_root_elements(
handler: xml.sax.saxutils.XMLGenerator
) - > null

Adds top-level elements to the feed's root, ensuring the feed-wide GeoRSS metadata is included.

Parameters

NameTypeDescription
handlerxml.sax.saxutils.XMLGeneratorThe XML handler instance used to generate the feed content.

Returns

TypeDescription
null