[gdal-dev] GDAL2 Python ds.GetDescription() is empty

Even Rouault even.rouault at spatialys.com
Tue Jan 15 12:18:25 PST 2019


Shawn,

> 
> I am using Python 2.7
> In my work, results are displayed like this:
> imageData =
> output_ds = gdal_array.OpenArray(imageData)
> output_ds.GetDescription()
> RasterLayer(ds=output_ds)
> 
> in GDAL1.9, output_ds.GetDescription() = 'NUMPY:::027D64D0'
> I use that unique name to instantiate a raster layer.
> But in GDAL2, output_ds.GetDescription() = ''  # an empty str
> Why is that?

For security reasons. Opening NUMPY:::random_address could crash GDAL

So unless you define GDAL_ARRAY_OPEN_BY_FILENAME=YES as configuration option/
env variable, gdal.Open('NUMPY:::xxxx') won't work anymore.
SetDescription() is indeed no longer set, not sure if I really intended it 
(kind of makes sense, if gdal.Open() doesn't work on it anymore by default). 
Anyway, you can get the connection string with 
gdal_array.GetArrayFilename(imageData).

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list