return centroid of event in lists

This commit is contained in:
Christian Quest 2016-05-06 15:59:18 +02:00
parent a47007c7dd
commit d966e626a3

View file

@ -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