Fothaí GeografachaLink to this heading

GeoDjango has its own Feed subclass that may embed location information in RSS/Atom feeds formatted according to either the Simple GeoRSS or W3C Geo standards. Because GeoDjango's syndication API is a superset of Django's, please consult Django's syndication documentation for details on general usage.

SamplaLink to this heading

Tagairt APILink to this heading

Fo-aicme FeathLink to this heading

class FeedLink to this definition

Chomh maith le modhanna a sholáthraíonn an:class: Django.Contrib.Syndication.Views.Feed bunaicme, soláthraíonn rang ``Feed ``GeoDjango na foriompaithe seo a leanas. Tabhair faoi deara gur féidir na sáruithe seo a dhéanamh ar bhealaí éagsúla:

Code
from django.contrib.gis.feeds import Feed


class MyFeed(Feed):
    # First, as a class attribute.
    geometry = ...
    item_geometry = ...

    # Also a function with no arguments
    def geometry(self): ...

    def item_geometry(self): ...

    # And as a function with a single argument
    def geometry(self, obj): ...

    def item_geometry(self, item): ...
geometry(obj)Link to this definition

Tógann sé an réad ar ais ag ``get_object () ``agus filleann sé an geoiméadrachta*feed's* ar ais. De ghnáth is cás “Geosgeoiméadracht” é seo, nó féadann sé a bheith ina tuple chun pointe nó bosca a léiriú. Mar shampla:

Code
class ZipcodeFeed(Feed):
    def geometry(self, obj):
        # Can also return: `obj.poly`, and `obj.poly.centroid`.
        return obj.poly.extent  # tuple like: (X0, Y0, X1, Y1).
item_geometry(item)Link to this definition

Socraigh é seo chun an geoiméadracht do ghach* míre* sa bheatha a thabhairt ar ais. Is féidir seo a bheith ina shampla ``Geosgeoimetry', nó tuple a léiríonn comhordú pointe nó bosca teorainneacha. Mar shampla:

Code
class ZipcodeFeed(Feed):
    def item_geometry(self, obj):
        # Returns the polygon.
        return obj.poly

Fo-aicmí SyndicationFeedLink to this heading

Tá na fo-aicmí seo a leanas: Django.Utils.FeedGenerator.SyndicationFeed ar fáil:

class GeoRSSFeedLink to this definition
class GeoAtom1FeedLink to this definition
class W3CGeoFeedLink to this definition