[Gdal-dev] Re: how to show the hdf file's subdataset's speacial band?

Andrey Kiselev dron at ak4719.spb.edu
Sun Nov 14 03:20:17 EST 2004


On Sun, Nov 14, 2004 at 02:47:38PM +0800, wlx wrote:
>       I don't know how to use the second way to show a band's image.
>       For example, if I use the gdal_translate command,how to do it?
>       Sorry to trouble you.

The gdal_translate utility has the switch '-b' to specify the bands. For
example, if you want to convert the first and the third bands from the
input image you can do the following:

 $ gdal_translate -b 1 -b 3 input.tif output.tif

So you should run gdalinfo on your HDF file first, select the subdataset
to convert and run the gdal_translate on that subdataset specifying the
band(s) you want to extract.

						Andrey


-- 
Andrey V. Kiselev
Home phone:  +7 812 5970603  ICQ# 26871517



More information about the Gdal-dev mailing list