[Gdal-dev] problem of gdal_translate 1.1.9 and 1.2.1 with multiplebands

Xiaodong Zhang zhang at aero.und.edu
Wed Jul 28 10:41:25 EDT 2004


Thanks Frank,

Yes you are right, I have to use gdal_translate -b 1 -b 2 -b 3 ... to spectrally
subset an image, but it only works for version 1.2.1 but not for 1.1.9. Version
1.1.9 produces only one band regardless. Both ways of sending '-b' arguments,
i.e., -b 1,2,3,4 or -b 1 -b 2 -b 3 -b 3, work for earlier version, 1.1.8.

On aother note, are there any significant changes for versions later than 1.1.8.
In another email, I reported that our program using gdal api crashes for both
version 1.1.9 and 1.2.1, while it works perfectly for version 1.1.8.

Thanks again.
Xiaodong

-- 
Xiaodong Zhang, Ph.D.
Assistant Professor
Earth System Science and Policy Program
University of North Dakota
Grand Fors, ND 58202-9007
(701)777-6087


Quoting Frank Warmerdam <warmerdam at pobox.com>:

> Xiaodong Zhang wrote:
> 
> > -------------------------------------
> > Then I run,
> > 
> > gdal_translate -b 1,2,3 -srcwin 100 100 200 200
> /mnt/dngp_images/3328_092002.tif
> > tmp.tif
> 
> Hi,
> 
> I think you need to use a seperate -b for each band requested.
> 
> eg.
> gdal_translate -b 1 -b 2 -b 3 -srcwin 100 100 200 200
> /mnt/dngp_images/3328_092002.tif tmp.tif
> 
> 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