summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2022-07-25 18:33:25 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-07-25 20:48:33 +0200
commit2d23a07817b67825735a6900ebed505a004f7788 (patch)
tree4bf899bb5a4fc993cb536d6a9febb270a2449b4a /docs
parent36cd4259438f98e74e472e232307a1909f164e56 (diff)
Fixed #33866 -- Added pathlib.Path support to GDALRaster constructor.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/gis/gdal.txt11
-rw-r--r--docs/releases/4.2.txt3
2 files changed, 11 insertions, 3 deletions
diff --git a/docs/ref/contrib/gis/gdal.txt b/docs/ref/contrib/gis/gdal.txt
index d5dba8677e..75915e6751 100644
--- a/docs/ref/contrib/gis/gdal.txt
+++ b/docs/ref/contrib/gis/gdal.txt
@@ -1107,9 +1107,10 @@ blue.
raster should be opened in write mode. For newly-created rasters, the second
parameter is ignored and the new raster is always created in write mode.
- The first parameter can take three forms: a string representing a file path
- (filesystem or GDAL virtual filesystem), a dictionary with values defining
- a new raster, or a bytes object representing a raster file.
+ The first parameter can take three forms: a string or
+ :class:`~pathlib.Path` representing a file path (filesystem or GDAL virtual
+ filesystem), a dictionary with values defining a new raster, or a bytes
+ object representing a raster file.
If the input is a file path, the raster is opened from there. If the input
is raw data in a dictionary, the parameters ``width``, ``height``, and
@@ -1160,6 +1161,10 @@ blue.
>>> rst.name # Stored in a random path in the vsimem filesystem.
'/vsimem/da300bdb-129d-49a8-b336-e410a9428dad'
+ .. versionchanged:: 4.2
+
+ Support for :class:`pathlib.Path` ``ds_input`` was added.
+
.. attribute:: name
The name of the source which is equivalent to the input file path or the name
diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt
index 1d55ea2f68..ad061857bf 100644
--- a/docs/releases/4.2.txt
+++ b/docs/releases/4.2.txt
@@ -57,6 +57,9 @@ Minor features
``id`` key for serialized features, which defaults to the primary key of
objects.
+* The :class:`~django.contrib.gis.gdal.GDALRaster` class now supports
+ :class:`pathlib.Path`.
+
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~