[gdal-dev] Band Initialization

Even Rouault even.rouault at spatialys.com
Mon Jul 29 09:44:23 PDT 2024


Andrew,

>
> Is a newly created raster band initialized to zero? If not, is there 
> some trivial way to perform such an initialization (this is a MEM 
> driver raster, if that matters).

This might be indeed driver dependent. Drivers will generally initialize 
to zero or the nodata value. As far as I can see, the MEM driver uses 
calloc() to initialize the buffer, so that should be zero. Otherwise you 
can use GDALRasterBand::Fill() to initialize at the value of your choice

Even

>
> -- 
> Andrew Bell
> andrew.bell.ia at gmail.com
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240729/f12fb67d/attachment.htm>


More information about the gdal-dev mailing list