Skip to content

Commit

Permalink
Use the same performance special case for 'country' as well as 'type'
Browse files Browse the repository at this point in the history
Presumably the same fix for odd PostGIS query planning needs to be done
for the new 'country' filter as for 'type', since these GET query
parameters modify the shape of the query in the same way.
  • Loading branch information
mhl committed Oct 25, 2017
1 parent 67317fa commit 293c06f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mapit/views/areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ def areas_by_point(request, srid, x, y, bb=False, format='json'):

args = query_args(request, format)
type = request.GET.get('type', '')
country = request.GET.get('country', '')

if type and method == 'polygon':
if (type or country) and method == 'polygon':
args = dict(("area__%s" % k, v) for k, v in args.items())
# So this is odd. It doesn't matter if you specify types, PostGIS will
# do the contains test on all the geometries matching the bounding-box
Expand Down

0 comments on commit 293c06f

Please sign in to comment.