[gdal-dev] Problem with gdal_translate : Illegal band #

Jean-Claude Repetto jrepetto at free.fr
Tue Mar 25 05:38:19 EDT 2008


Hello,
I have downloaded a map of Corsica at 
<http://www.ign.fr/telechargement/MPro/produit/SCANS/SCAN1000_Corse_L2E.zip> 
.

Now, I want to convert it to ECW with gdal_translate. As it uses a 
palette, I first need to convert it to RGB.

mv COR_0000.TIF COR_0000.TIF.orig
pct2rgb.py COR_0000.TIF.orig COR_0000.TIF
gdal_translate -of ECW -co "TARGET=88" -co "DATUM=NTF"  -co 
"PROJ=LM2FRANC"  -co "LARGE_OK=YES" COR_0000.TIF COR_0000.ecw

Input file size is 1200, 2200
Warning 6: '88' is an unexpected value for TARGET creation option of 
type float.
0...10...20...30...40...50...60...70...80...90...100 - done.
ERROR 5: GDALDataset::GetRasterBand(2) - Illegal band #

ERROR 5: GDALDataset::GetRasterBand(3) - Illegal band #

The ECW file is created, but it contains garbage.
At this time, if I execute the same command again :

gdal_translate -of ECW -co "TARGET=88" -co "DATUM=NTF"  -co 
"PROJ=LM2FRANC"  -co "LARGE_OK=YES" COR_0000.TIF COR_0000.ecw

Input file size is 1200, 2200
Warning 6: '88' is an unexpected value for TARGET creation option of 
type float.
0...10...20...30...40...50...60...70...80...90...100 - done.

It works and the ECW file is correct. If I delete the ECW file and 
launch the same command, the errors come back.
I am using GDAL 1.5.0.

Any idea ?

Thanks,
Jean-Claude



More information about the gdal-dev mailing list