[gdal-dev] Problem with gdal_merge.py (ubuntu 8.04)

Agustin Lobo aloboaleu at gmail.com
Thu Apr 2 12:52:00 EDT 2009


Hi!
I run gdal_merge.py and get:

$ /usr/local/FWTools-2.0.6/bin_safe/gdal_merge.py -v -o 
PICT0126radcorr.tif -separate PICT0126Nradcorr.tif PICT0126Rradcorr.tif 
PICT0126Gradcorr.tif

Filename: PICT0126Nradcorr.tif
File Size: 2560x1920x1
Pixel Size: 1.000000 x 1.000000
UL:(0.000000,0.000000)   LR:(2560.000000,1920.000000)
Copy 0,0,2560,1920 to 0,0,2560,1920.

Filename: PICT0126Rradcorr.tif
File Size: 2560x1920x1
Pixel Size: 1.000000 x 1.000000
UL:(0.000000,0.000000)   LR:(2560.000000,1920.000000)
Copy 0,0,2560,1920 to 0,0,2560,1920.
Traceback (most recent call last):
   File "/usr/local/FWTools-2.0.6/bin/gdal_merge.py", line 505, in ?
     fi.copy_into( t_fh, 1, t_band, nodata )
   File "/usr/local/FWTools-2.0.6/bin/gdal_merge.py", line 303, in copy_into
     nodata_arg )
   File "/usr/local/FWTools-2.0.6/bin/gdal_merge.py", line 133, in 
raster_copy
     t_band = t_fh.GetRasterBand( t_band_n )
   File "/usr/local/FWTools-2.0.6/pymod/gdal.py", line 648, in GetRasterBand
     raise ValueError, 'Out of range band requested: %d' % i
ValueError: Out of range band requested: 2

Am I doing something wrong? According to what I've found, this is the 
correct syntax.

I include gdalinfo:

$ gdalinfo  PICT0126Rradcorr.tif
Driver: GTiff/GeoTIFF
Files: PICT0126Rradcorr.tif
Size is 2560, 1920
Coordinate System is `'
Image Structure Metadata:
   INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1920.0)
Upper Right ( 2560.0,    0.0)
Lower Right ( 2560.0, 1920.0)
Center      ( 1280.0,  960.0)
Band 1 Block=2560x1 Type=Float32, ColorInterp=Gray


Thanks

Agus

-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster


More information about the gdal-dev mailing list