From d966e626a34eb28030503c455cc4ee4b5d0a9d6f Mon Sep 17 00:00:00 2001 From: Christian Quest Date: Fri, 6 May 2016 15:59:18 +0200 Subject: [PATCH] return centroid of event in lists --- backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend.py b/backend.py index ac8aaa0..8887a82 100644 --- a/backend.py +++ b/backend.py @@ -56,7 +56,7 @@ class EventResource(object): if id is None: cur.execute(""" SELECT format('{"type": "FeatureCollection","features": [%s]}',string_agg(feature,',')) FROM - (SELECT '{"type":"Feature", "properties": '|| events_tags::text ||', "geometry":'|| st_asgeojson(geom) ||' }' as feature + (SELECT '{"type":"Feature", "properties": '|| events_tags::text ||', "geometry":'|| st_asgeojson(st_centroid(geom)) ||' }' as feature FROM events JOIN geo ON (hash=events_geo) WHERE events_when @> format('[%s,%s]', now(), now())::tstzrange