[gdal-dev] Some questions ...

Frank Warmerdam warmerdam at pobox.com
Fri Feb 15 17:23:28 EST 2008


mario beaulieu wrote:
> GDAL version 1.5
>  
> I have 2 questions.
>  
> 1) I want to add a raster band to a GEOTIFF dataset.  Is there any  
> method to do it since the driver seem not to support the AddBand method?
>  
>         ERROR 6: Dataset does not support the AddBand() method.

Mario,

The AddBand() method is the correct method, but hardly any drivers support
adding a band to an existing dataset. I suspect the MEM and VRT drivers
are the only ones that currently support it.

> 2) I want to create 1 BBP raster band and save it in TIFF.  How can I do?

Pass the creation option NBITS=1 to the GTiff driver Create/CreateCopy
methods.  Note, this may not work properly in pre-GDAL/OGR 1.5 versions.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list