id/createdate/lastupdate added to properties
This commit is contained in:
parent
d966e626a3
commit
ad965fffee
1 changed files with 2 additions and 2 deletions
|
@ -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(st_centroid(geom)) ||' }' as feature
|
||||
(SELECT '{"type":"Feature", "properties": '|| (events_tags::jsonb || jsonb_build_object('id',events_id,'createdate',createdate,'lastupdate',lastupdate))::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
|
||||
|
@ -66,7 +66,7 @@ SELECT format('{"type": "FeatureCollection","features": [%s]}',string_agg(featur
|
|||
else:
|
||||
# get event geojson Feature
|
||||
cur.execute("""
|
||||
SELECT format('{"type":"Feature", "properties": '|| events_tags::text ||', "geometry":'|| st_asgeojson(geom)) ||' }'
|
||||
SELECT format('{"type":"Feature", "properties": '|| (events_tags::jsonb || jsonb_build_object('id',events_id,'createdate',createdate,'lastupdate',lastupdate))::text ||', "geometry":'|| st_asgeojson(geom)) ||' }'
|
||||
FROM events
|
||||
JOIN geo ON (hash=events_geo)
|
||||
WHERE events_id=%s;""", (id,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue