summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaniel Wiesmann <daniel.wiesmann@gmail.com>2017-05-23 20:07:16 +0100
committerTim Graham <timograham@gmail.com>2017-06-07 11:30:35 -0400
commite0b456bee7bcf37e2a55471255686ee59c6cf03c (patch)
tree69823c29c563e009abd5dad777ce6fb363cde331 /docs
parent23825b2494a1edb1e02d57dbdc7eca0614cefcc8 (diff)
Fixed #28232 -- Made raster metadata readable and writable on GDALRaster/Band.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/gis/gdal.txt41
-rw-r--r--docs/releases/2.0.txt5
2 files changed, 46 insertions, 0 deletions
diff --git a/docs/ref/contrib/gis/gdal.txt b/docs/ref/contrib/gis/gdal.txt
index 3edcf48bd6..d6501cbf48 100644
--- a/docs/ref/contrib/gis/gdal.txt
+++ b/docs/ref/contrib/gis/gdal.txt
@@ -1391,6 +1391,40 @@ blue.
>>> target.origin
[-82.98492744885776, 27.601924753080144]
+ .. attribute:: info
+
+ .. versionadded:: 2.0
+
+ Returns a string with a summary of the raster. This is equivalent to
+ the `gdalinfo`__ command line utility.
+
+ __ http://www.gdal.org/gdalinfo.html
+
+ .. attribute:: metadata
+
+ .. versionadded:: 2.0
+
+ The metadata of this raster, represented as a nested dictionary. The
+ first-level key is the metadata domain. The second-level contains the
+ metadata item names and values from each domain.
+
+ To set or update a metadata item, pass the corresponding metadata item
+ to the method using the nested structure described above. Only keys
+ that are in the specified dictionary are updated; the rest of the
+ metadata remains unchanged.
+
+ To remove a metadata item, use ``None`` as the metadata value.
+
+ >>> rst = GDALRaster({'width': 10, 'height': 20, 'srid': 4326})
+ >>> rst.metadata
+ {}
+ >>> rst.metadata = {'DEFAULT': {'OWNER': 'Django', 'VERSION': '1.0'}}
+ >>> rst.metadata
+ {'DEFAULT': {'OWNER': 'Django', 'VERSION': '1.0'}}
+ >>> rst.metadata = {'DEFAULT': {'OWNER': None, 'VERSION': '2.0'}}
+ >>> rst.metadata
+ {'DEFAULT': {'VERSION': '2.0'}}
+
``GDALBand``
------------
@@ -1539,6 +1573,13 @@ blue.
[2, 2, 2, 2],
[3, 3, 3, 3]], dtype=uint8)
+ .. attribute:: metadata
+
+ .. versionadded:: 2.0
+
+ The metadata of this band. The functionality is identical to
+ :attr:`GDALRaster.metadata`.
+
.. _gdal-raster-ds-input:
Creating rasters from data
diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt
index fef59ba880..3b7a5a74f1 100644
--- a/docs/releases/2.0.txt
+++ b/docs/releases/2.0.txt
@@ -78,6 +78,11 @@ Minor features
* Added the :attr:`.OSMWidget.default_zoom` attribute to customize the map's
default zoom level.
+* Made metadata readable and editable on rasters through the
+ :attr:`~django.contrib.gis.gdal.GDALRaster.metadata`,
+ :attr:`~django.contrib.gis.gdal.GDALRaster.info`, and
+ :attr:`~django.contrib.gis.gdal.GDALBand.metadata` attributes.
+
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~