summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorDaniel Wiesmann <daniel.wiesmann@gmail.com>2015-03-17 11:33:25 +0000
committerTim Graham <timograham@gmail.com>2015-03-17 08:16:12 -0400
commitb9cb81570e24284156e09ab1fdc3c19a8d563b07 (patch)
tree88795d041e6a73451601e4458aba0ff10e6386ff /django
parentf269c1d6f6dcc22c0a781f3223c6da0a4483b06e (diff)
Made SRID a required parameter for GDALRaster instantiation; refs #23804.
Earlier versions of GDAL do not allow the srid to be set to 0, so it should be a required parameter to ensure compatibility.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/gdal/raster/source.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/contrib/gis/gdal/raster/source.py b/django/contrib/gis/gdal/raster/source.py
index 06f6b5b03f..6f36a10823 100644
--- a/django/contrib/gis/gdal/raster/source.py
+++ b/django/contrib/gis/gdal/raster/source.py
@@ -90,6 +90,10 @@ class GDALRaster(GDALBase):
if 'width' not in ds_input or 'height' not in ds_input:
raise GDALException('Specify width and height attributes for JSON or dict input.')
+ # Check if srid was specified
+ if 'srid' not in ds_input:
+ raise GDALException('Specify srid for JSON or dict input.')
+
# Create GDAL Raster
self._ptr = capi.create_ds(
driver._ptr,
@@ -108,7 +112,7 @@ class GDALRaster(GDALBase):
self.bands[i].nodata_value = band_input['nodata_value']
# Set SRID, default to 0 (this assures SRS is always instanciated)
- self.srs = ds_input.get('srid', 0)
+ self.srs = ds_input.get('srid')
# Set additional properties if provided
if 'origin' in ds_input: