[gdal-dev] SetNoDataValue on in-memory datasets via python

Even Rouault even.rouault at spatialys.com
Mon Dec 18 10:04:49 PST 2017


Jake,

> 
>     mem_s_fh = gdal.GetDriverByName("MEM").Create('', temp_cols, temp_rows,
> 1, gdal.GDT_Float32) mem_s_fh.SetGeoTransform([0, cell_size, 0, 0, 0,
> cell_size])
>     mem_s_fh.SetNoDataValue(s_nodata)

SetNoDataValue() is a rasterband level method, not dataset.

So should be s_band.SetNoDataValue(s_nodata)

>     s_band = mem_s_fh.GetRasterBand(1)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171218/d2fa7710/attachment.html>


More information about the gdal-dev mailing list