str() removed around mogrify

This commit is contained in:
Christian Quest 2016-05-07 10:44:27 +02:00
parent bdb1a9d3dc
commit 10b92cb555

View file

@ -59,10 +59,10 @@ class EventResource(object):
if 'bbox' in req.params:
# limit search with bbox (E,S,W,N)
event_bbox = str(cur.mogrify(" AND geom && ST_SetSRID(ST_MakeBox2D(ST_Point(%s,%s),ST_Point(%s,%s)),4326) ",tuple(req.params['bbox']))).decode("utf-8")
event_bbox = cur.mogrify(" AND geom && ST_SetSRID(ST_MakeBox2D(ST_Point(%s,%s),ST_Point(%s,%s)),4326) ",tuple(req.params['bbox'])).decode("utf-8")
elif 'near' in req.params:
# limit search with location+distance (long, lat, distance in meters)
event_bbox = str(cur.mogrify(" AND geom && st_expand(st_buffer(st_setsrid(st_makepoint(%s,%s),4326)::geography,%s)::geometry,0) ",tuple(req.params['near']))).decode("utf-8")
event_bbox = cur.mogrify(" AND geom && st_expand(st_buffer(st_setsrid(st_makepoint(%s,%s),4326)::geography,%s)::geometry,0) ",tuple(req.params['near'])).decode("utf-8")
else:
event_bbox = ""