[Gdal-dev] CreateCopy or Create to fill with zeros?

Simon Perkins sy at perkins.net
Fri May 19 19:28:25 EDT 2006


You can use Create() to create a dataset of the appropriate size, and 
then you can use the GDALFillRaster() function (or 
GDALRasterBand::Fill()) to fill it with any value you like. I'm pretty 
sure that drivers are not in general guaranteed to fill a newly created 
dataset with zeros, though I expect some do.

Cheers,

Sy


Charles Wivell wrote:
> Hi all;
>
> Simple question... I have a very large Dataset and I want to copy it, except that,  instead of copying the raster data, I want it filled with zeros. Can I use CreateCopy(...) with something set in the papzOptions.....? I know I can use Create(...), but I'm not sure if Create(...) zeros the disk space where the raster data is stored.
>
> I'm programming in C++.
>
> Thanks
>
> Chuck Wivell
> MN DNR 
>
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org 
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>   




More information about the Gdal-dev mailing list