summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2015-11-13 14:44:15 +0500
committerTim Graham <timograham@gmail.com>2015-11-23 17:23:30 -0500
commit013309eaf55ca88e4c412d2a83a95c60691dfe50 (patch)
tree7856840aa6f514bf7711f235667b8704ebd9f681
parent8edf8db52f626e6bf384a729063f91caa6592f92 (diff)
[1.9.x] Refs #25739 -- Lessened the prominence of geos.fromstr() in the docs.
Backport of 97e1d2433085e01696dc2fac8bfbb9c421c82b67 from master
-rw-r--r--docs/ref/contrib/gis/db-api.txt4
-rw-r--r--docs/ref/contrib/gis/geos.txt10
2 files changed, 8 insertions, 6 deletions
diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt
index fd12eb1901..c9bbec037c 100644
--- a/docs/ref/contrib/gis/db-api.txt
+++ b/docs/ref/contrib/gis/db-api.txt
@@ -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)
diff --git a/docs/ref/contrib/gis/geos.txt b/docs/ref/contrib/gis/geos.txt
index f35bd0b1e5..0a69faf64a 100644
--- a/docs/ref/contrib/gis/geos.txt
+++ b/docs/ref/contrib/gis/geos.txt
@@ -65,11 +65,10 @@ created by passing in the X and Y coordinates into its constructor::
>>> from django.contrib.gis.geos import Point
>>> pnt = Point(5, 23)
-Finally, there are :func:`fromstr` and :func:`fromfile` factory methods, which
-return a :class:`GEOSGeometry` object from an input string or a file::
+Finally, there is the :func:`fromfile` factory method which returns a
+:class:`GEOSGeometry` object from a file::
- >>> from django.contrib.gis.geos import fromstr, fromfile
- >>> pnt = fromstr('POINT(5 23)')
+ >>> from django.contrib.gis.geos import fromfile
>>> pnt = fromfile('/path/to/pnt.wkt')
>>> pnt = fromfile(open('/path/to/pnt.wkt'))
@@ -804,6 +803,9 @@ Example::
:type srid: int
:rtype: a :class:`GEOSGeometry` corresponding to the spatial data in the string
+``fromstr(string, srid)`` is equivalent to :class:`GEOSGeometry(string, srid)
+<GEOSGeometry>`.
+
Example::
>>> from django.contrib.gis.geos import fromstr