[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH] Add geographic references of maps to RSS feed (
From: |
gael . utard |
Subject: |
[Maposmatic-dev] [PATCH] Add geographic references of maps to RSS feed (GeoRSS). |
Date: |
Fri, 6 Aug 2010 19:07:20 +0200 |
From: Gaël Utard <address@hidden>
Currently, this works only for bounding boxes, not for administrative
boundaries.
Signed-off-by: Gaël Utard <address@hidden>
---
www/maposmatic/feeds.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/www/maposmatic/feeds.py b/www/maposmatic/feeds.py
index 5f3dc58..75c73a9 100644
--- a/www/maposmatic/feeds.py
+++ b/www/maposmatic/feeds.py
@@ -26,7 +26,7 @@
import datetime
-from django.contrib.syndication.feeds import Feed
+from django.contrib.gis.feeds import Feed
from django.utils.translation import ugettext_lazy as _
from www.maposmatic import models
@@ -69,3 +69,9 @@ class MapsFeed(Feed):
def item_title(self, item):
return item.maptitle
+ def item_geometry(self, item):
+ if item.administrative_city:
+ return None
+ else:
+ return (item.lon_upper_left, item.lat_upper_left,
+ item.lon_bottom_right, item.lat_bottom_right)
--
1.7.0.4