[Gdal-dev] gdal_translate to select multiple bands?

Frank Warmerdam warmerdam at pobox.com
Fri Feb 14 10:55:34 EST 2003


Vincent Schut wrote:
> Hi all,
> 
> Am I right when I assume that gdal_translate cannot be used to extract a 
> selection of more then 1 band from an image? E.g. I have a 4 band tiff and I 
> want only bands 2,3,4, I cannot type 'gdal_translate -b 2,3,4 ...... ?

Vincent,

You are correct.  What you want can be accomplished (with some hassle) by
converting to VRT format, editing the .vrt file to remove the first band
and renumber the remainder to 1,2,3 and then converting that .vrt file to
your desired output format.

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    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list