[gdal-dev] Creating JPEGs with gdal2tiles using 4-band GeoTIFFs (RGB+NIR)

Josh Doe josh at joshdoe.com
Sat Oct 22 00:22:04 EDT 2011


Hello,
I've gotten 4-band imagery from USGS for Virginia, and it's stored in
GeoTIFF format. The bands are R, G, B, and NIR. I tried running
gdal2tiles directly on one of these files, and got a bad result, since
it interpreted the NIR band as an alpha channel. I tried looking in
the source to ignore this fourth band and just write out simple JPEGs
using the first three bands, but couldn't figure out how to do so.
Anyone else try this?

I was able to convert one file to just RGB using "gdal_translate -b 1
-b 2 -b 3 ...", and then gdal2tiles was successful, however I have
thousands of GeoTIFFs to work with and might not have the space to be
converting the whole batch to eliminate the NIR band.

Thanks for any help,
-Josh


More information about the gdal-dev mailing list