#7934: adding "nearest_to" search to geodjango
---------------------------------+------------------------------------------
Reporter: lkcl | Owner:
Status: closed | Milestone:
Component: GIS | Version: gis
Resolution: wontfix | Keywords: nearest_to queryset
Stage: Unreviewed | Has_patch: 1
Needs_docs: 1 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Changes (by jbronn):
* status: new => closed
* resolution: => wontfix
Comment:
The existing distance API already has such functionality, for example the
`distance_lte` and `dwithin` lookup types and/or using the `distance`
`GeoQuerySet` method:
{{{
#!python
>>> from django.contrib.gis.geos import Point
>>> from django.contrib.gis.measure import D
>>> pnt = Point(x, y)
>>> qs = GeoModel.objects.filter(point__distance_lte=(pnt, D(mi=5))) #
Find all objects w/in 5 miles of pnt
>>> qs = GeoModel.objects.distance(pnt).order_by('distance') # Ordered
queryset by distance from pnt
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/7934#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---