mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #25739 -- Lessened the prominence of geos.fromstr() in the docs.
This commit is contained in:
committed by
Tim Graham
parent
2ab244ff3a
commit
97e1d24330
@@ -229,11 +229,11 @@ in southern Texas::
|
||||
|
||||
Then distance queries may be performed as follows::
|
||||
|
||||
>>> from django.contrib.gis.geos import fromstr
|
||||
>>> from django.contrib.gis.geos import GEOSGeometry
|
||||
>>> from django.contrib.gis.measure import D # ``D`` is a shortcut for ``Distance``
|
||||
>>> from geoapp.models import SouthTexasCity
|
||||
# Distances will be calculated from this point, which does not have to be projected.
|
||||
>>> pnt = fromstr('POINT(-96.876369 29.905320)', srid=4326)
|
||||
>>> pnt = GEOSGeometry('POINT(-96.876369 29.905320)', srid=4326)
|
||||
# If numeric parameter, units of field (meters in this case) are assumed.
|
||||
>>> qs = SouthTexasCity.objects.filter(point__distance_lte=(pnt, 7000))
|
||||
# Find all Cities within 7 km, > 20 miles away, and > 100 chains away (an obscure unit)
|
||||
|
||||
Reference in New Issue
Block a user