From b9cb81570e24284156e09ab1fdc3c19a8d563b07 Mon Sep 17 00:00:00 2001 From: Daniel Wiesmann Date: Tue, 17 Mar 2015 11:33:25 +0000 Subject: 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. --- django/contrib/gis/gdal/raster/source.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'django') 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: -- cgit v1.3