I'm trying to get N points within 5000 meters of a certain point. My database is Postgres(PostGis). I have a model like this:
class Theatre(models.Model):
geom = models.PointField(srid=4326, blank=True, null=True, default=None)
objects = models.GeoManager()
Then I ran a couple lines in django shell:
Theatre.objects.filter(geom__dwithin=(GEOSGeometry('POINT(30.111199 -97.309990)'), D(m=5000)))
and I get error:
ValueError: Only numeric values of degree units are allowed on geographic DWithin queries.
I found the document in here and it says calculating the geometry distance..
Please help.. Thanks very much!!