Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to mosaic the True Marble world imagery 250M geotiffs using though one of them doesn't have RGB bands like the rest and gdal_merge fails (same number of bands is listed as a requirement in it's documentation). This is the error I get:

python.exe : ERROR 5: TrueMarble.250m.21600x21600.B4.tif: GDALDataset::GetRasterBand(2) - Illegal band #

This is the tile causing the issue: TrueMarble.250m. 21600x21600.B4

Should I use a different mosaic tool or should I try to coerce the tile into the format gdal_merge requires somehow?

share|improve this question
up vote 5 down vote accepted

I ran across this mosaicing the True Marble imagery as well, though I used gdalbuildvrt and then gdal_translate. From memory, the recalcitrant tiffs are stored as a single band with a color table.

Just convert them to 3 band RGB with gdal_translate:

gdal_translate -expand rgb TrueMarble.250m.21600x21600.B4.tif TrueMarble.250m.21600x21600.B4.RGB.tif
share|improve this answer
That's it! thanks Luke :) I tried just gdal_translate in hopes that might do it but I wasn't aware of the -expand parameter :). btw +1 for use of the word recalcitrant :P – Andy Arismendi May 30 '13 at 5:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.