GeoDjango and bug with bounding box query

المشرف العام

Administrator
طاقم الإدارة
Just some context first, I have a postgres database with PostGIS extension, running under a GeoDjango wrapper. I have a weird bug that hopefully someone can shed some light on.

I'm running a query like this

geom = Polygon.from_bbox(bbox)query = Venue.objects.filter(location__within=geom)This works fine for most cases and is doing exactly what I want, except for in one specific situation where I get a result that looks like this



(for reference, the bbox param above is always defined by the SW and NE corners of the map which in this case are

sw_lat:50.98777649091917sw_lng:-0.9302881336211613ne_lat:52.15534947527341ne_lng:0.06946772575383875)

I've been trying to narrow down the problem, and I'm starting to think it might be something to do with crossing from negative to positive longitude, but I'm not sure. Or maybe it is something to do with indexing on the database level?

Any insight would be appreciated.



أكثر...
 
أعلى