---
title: "Fothaí Geografacha"
version: 5.2
locale: ga
source: https://docs.djangoproject.com/ga/5.2/ref/contrib/gis/feeds/
canonical: https://djangodocs.dev/ga/5.2/ref/contrib/gis/feeds/
---
# Fothaí Geografacha

Tá a fho-aicme féin ag GeodJango: aicme: Feed a d'fhéadfadh faisnéis suímh a leabú i bhfothaí RSS/Atom atá formáidithe de réir na gcaighdeán [Simple Georss \`\_\_ nó \`W3C Geo](https://www.w3.org/2003/01/geo/). Toisc gur superset de Django é API sindiciúcháin GeodJango, téigh i gcomhairle le do thoil: doc: 'Doiciméadú sionnaithe Django' le haghaidh sonraí maidir le húsáid ghinearálta \</ref/contrib/syndication\>.

## Sampla

## Tagairt API

### Fo-aicme `Feath`

#### `class Feed`

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:

```
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)`

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:

```
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)`

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:

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

### Fo-aicmí `SyndicationFeed`

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

#### `class GeoRSSFeed`

#### `class GeoAtom1Feed`

#### `class W3CGeoFeed`

> **Note**
>
> Ní thacaíonn fothaí formáidithe [W3C Geo](https://www.w3.org/2003/01/geo/) ach le geoiméadrachtaí: class: ~django.contrib.gis.db.Models.pointfield.
