[gdal-dev] how to manipulate and save only one band
Gong, Shawn (Contractor)
Shawn.Gong at drdc-rddc.gc.ca
Fri Jun 6 16:57:34 EDT 2008
hi list,
I appreciate if someone shows me how to manipulate and save only one
band out of a multi-band raster.
someone wrote codes as follows (results are band 1 is modified, the rest
remain same)
vrtds=gdal.Open(vrtstr) # multi-band raster
self.new_ds = gtiff_driver.CreateCopy( fname, vrtds, options =
['TILED=YES',],..)
bandobj = self.new_ds.GetRasterBand(1)
datablock = gdalnumeric.BandReadAsArray( bandobj, ..)
... ...
gdalnumeric.BandWriteArray( bandobj, datablock, 0,..)
What I would like to do is: only keep the modified band_1 and delete
rest bands from "self.new_ds"
does gdal_dataset has a method called DeleteBand()?
thanks,
Shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080606/6367cd95/attachment.html
More information about the gdal-dev
mailing list