Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Using PostGis and GeoDjango with a model having a Geography field I'm trying to exclude results where the location is 0,0. I get the error PostGIS geography does not support the "exact" lookup. The only thing I can think to do is exclude points that are 0 meters from 0,0:

.exclude(location__distance_lte=(Point(0, 0), D(m=1)))

Is there a better way?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

try this:

.exclude(location__intersects=Point(0, 0))

The intersects spatial lookup is one of the four available on geography column types in GeoDjango.

In PostGIS, ST_Intersects natively supports geography column types and has a tolerance of about 0.00001 metres.

More info:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.