Umpan GeografisLink 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.
ContohLink to this heading
Acuan APILink to this heading
Subkelas FeedLink to this heading
- class FeedLink to this definition
Sebagai tambahan pada metode disediakan oleh kelas dasar
django.contrib.syndication.views.Feed, kelasFeedGeoDjango menyediakan penimpaan berikut. Catat bahwa penimpaan ini mungkin dilakukan dalam banyak cara: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
Ambil obyek dikembalikan oleh
get_object()dan mengembalikan geometri feed. Khususnya ini adalah instanceGEOSGeometry, atau dapat berupa sebuah tuple untuk mewakili titik atau sebuah kotak. Sebagai contoh: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
Setel ini untuk mengembalikan geometri untuk setiap item dalam umpan. Ini dapat berupa instance
GEOSGeometry, atau tuple yang mewakili titik kordinat atau kotak batasan. Sebagai contoh:class ZipcodeFeed(Feed): def item_geometry(self, obj): # Returns the polygon. return obj.poly