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
| Type | Description |
|---|---|
dict | A 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
| Name | Type | Description |
|---|---|---|
| handler | xml.sax.saxutils.XMLGenerator | The XML handler instance used to generate the feed content. |
| item | dict | A dictionary containing the data for a specific feed entry, including its geographic coordinates. |
Returns
| Type | Description |
|---|---|
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
| Name | Type | Description |
|---|---|---|
| handler | xml.sax.saxutils.XMLGenerator | The XML handler instance used to generate the feed content. |
Returns
| Type | Description |
|---|---|
null |