update
This commit is contained in:
@ -83,9 +83,11 @@ def LocationInBound(request):
|
|||||||
cat = request.GET.get('cat')
|
cat = request.GET.get('cat')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(lat1 != None and lon1 != None and lat2 != None and lon2 != None and lat3 != None and lon3 != None and lat4 != None and lon4 != None):
|
if(lat1 != None and lon1 != None and lat2 != None and lon2 != None and lat3 != None and lon3 != None and lat4 != None and lon4 != None):
|
||||||
pl = geos.Polygon(((lon1, lat1), (lon2, lat2), (lon3, lat3), (lon4, lat4), (lon1, lat1)), srid=4326)
|
pl = geos.Polygon(((lon1, lat1), (lon2, lat2), (lon3, lat3), (lon4, lat4), (lon1, lat1)), srid=4326)
|
||||||
if(cat):
|
if(cat):
|
||||||
|
print("----res from cat")
|
||||||
locs = Location.objects.filter(geom__within=pl, category=cat)
|
locs = Location.objects.filter(geom__within=pl, category=cat)
|
||||||
else:
|
else:
|
||||||
locs = Location.objects.filter(geom__within=pl)
|
locs = Location.objects.filter(geom__within=pl)
|
||||||
|
|||||||
Reference in New Issue
Block a user