I'm using geocoder, I have database of coordinates, I want to fetch the coodinates within the radius of 5 km using geocoder. In rails I could do that as followed:
Venue.near([40.71, -100.23], 20) # venues within 20 miles of a point
how to do this using django geocoder????
You can use this How to get the nearest location entries from a database?. Example :
from django.contrib.gis.measure import D
from django.contrib.gis.geos import *
from myapp.models import MyResult
pnt = fromstr('POINT(48.796777 2.371140 )', srid=4326)
qs = MyResul
t.objects.filter(point__distance_lte=(pnt, D(km=20)))