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 using gdal_retile to create ImagePyramid from a set of GeoTIFF images. I'm using following command: -v -r bilinear -levels 8 -ps 2048 2048 -co "TILED=YES" -co "COMPRESS=JPEG" -targetDir F:/tiles --optfile F:/tileslist.txt

After couple of hours(source images are 320GB) I get following error message:

Traceback (most recent call last):
  File "C:\PROGRA~2\FWTOOL~1.7\bin\", line 940, in ?
  File "C:\PROGRA~2\FWTOOL~1.7\bin\", line 857, in main
    dsCreatedTileIndex = tileImage(minfo,ti)
  File "C:\PROGRA~2\FWTOOL~1.7\bin\", line 335, in tileImage
    createTile(minfo, offsetX, offsetY, width, height,tilename,OGRDS)
  File "C:\PROGRA~2\FWTOOL~1.7\bin\", line 467, in createTile
  File "C:\PROGRA~2\FWTOOL~1.7\bin\", line 246, in getDataSet
    s_band = sourceDS.GetRasterBand( bandNr )
  File "C:\PROGRA~2\FWTOOL~1.7\pymod\", line 654, in GetRasterBand
    raise ValueError, 'Out of range band requested: %d' % i
ValueError: Out of range band requested: 2

I tried to retile separately images that execution stops on, but then I get no error message. Everything works well, so my guess that it's something wrong with the source image doesn't seem to be valid.

Does anyone have any other ideas of what could be wrong or how I should troubleshoot the problem?

share|improve this question

Try running gdalinfo on the files that give you trouble, and the files that are ok, and looking at the number of bands. Quickly looking over the code, it looks like doesn't handle images with different numbers of bands.

If that's the case, you'll need to use gdal_translate to expand or repeat bands so all the files are the same depth.

share|improve this answer

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.