summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorrico-ci <riccardo@continuum.industries>2020-06-18 14:52:02 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-07 09:26:44 +0200
commitcb0da637a69b79ab371be9ee202335190a3a506e (patch)
tree44d2b23405be4550cf766e94929257f84149fb14 /docs
parent7af8f4127397279d19ef7c7899e93018274e2f9b (diff)
Fixed #31713 -- Added SpatialReference support to GDALRaster.transform().
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/gis/gdal.txt21
-rw-r--r--docs/releases/3.2.txt3
2 files changed, 16 insertions, 8 deletions
diff --git a/docs/ref/contrib/gis/gdal.txt b/docs/ref/contrib/gis/gdal.txt
index 857d8d02f5..aa7e2a7eb8 100644
--- a/docs/ref/contrib/gis/gdal.txt
+++ b/docs/ref/contrib/gis/gdal.txt
@@ -1368,14 +1368,16 @@ blue.
[ 19., 21., 23.],
[ 31., 33., 35.]], dtype=float32)
- .. method:: transform(srid, driver=None, name=None, resampling='NearestNeighbour', max_error=0.0)
+ .. method:: transform(srs, driver=None, name=None, resampling='NearestNeighbour', max_error=0.0)
- Returns a transformed version of this raster with the specified SRID.
+ Transforms this raster to a different spatial reference system
+ (``srs``), which may be a :class:`SpatialReference` object, or any
+ other input accepted by :class:`SpatialReference` (including spatial
+ reference WKT and PROJ strings, or an integer SRID).
- This function transforms the current raster into a new spatial reference
- system that can be specified with an ``srid``. It calculates the bounds
- and scale of the current raster in the new spatial reference system and
- warps the raster using the :attr:`~GDALRaster.warp` function.
+ It calculates the bounds and scale of the current raster in the new
+ spatial reference system and warps the raster using the
+ :attr:`~GDALRaster.warp` function.
By default, the driver of the source raster is used and the name of the
raster is the original name appended with
@@ -1394,10 +1396,15 @@ blue.
... "scale": [100, -100],
... "bands": [{"data": range(36), "nodata_value": 99}]
... })
- >>> target = rst.transform(4326)
+ >>> target_srs = SpatialReference(4326)
+ >>> target = rst.transform(target_srs)
>>> target.origin
[-82.98492744885776, 27.601924753080144]
+ .. versionchanged:: 3.2
+
+ Support for :class:`SpatialReference` ``srs`` was added
+
.. attribute:: info
Returns a string with a summary of the raster. This is equivalent to
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt
index 9f1d785934..88c4cdc998 100644
--- a/docs/releases/3.2.txt
+++ b/docs/releases/3.2.txt
@@ -68,7 +68,8 @@ Minor features
:mod:`django.contrib.gis`
~~~~~~~~~~~~~~~~~~~~~~~~~
-* ...
+* The :meth:`.GDALRaster.transform` method now supports
+ :class:`~django.contrib.gis.gdal.SpatialReference`.
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~