[gdal-dev] Merging 3 1-band GeoTIFFs in 1 3-band GeoTIFF

Jorge Arevalo jorgearevalo at libregis.org
Tue Jan 15 04:34:13 PST 2013


Hello,

I have 3 single band GeoTIFF files, with UInt16 data type. I want to
merge them in a single GeoTIFF file, with 3 bands, and RGB color
interpretation

I've read this http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028451.html

So, I tried to do this:

 gdal_merge.py -separate -co "SAMPLESPERPIXEL=3" -co
"BITSPERSAMPLE=16" -co "PHOTOMETRIC=RGB" -o output.tif file1.tif
file2.tif file3.tif

Of course, it didn't work. All the pixels of output.tif are 0. Reasons:

- GTiff does not support BITSPERSAMPLE or SAMPLESPERPIXEL creation options.
- This is a guess, but I think PHOTOMETRIC=RGB can't be used with
pixels of type different from Byte
- ?

Another thing I tried was to use gdalbuildvrt, and add color
interpretation for bands. No effect. Plus, my original raster files
are rotated, and I had to warp them. I shouldn't modify the input data
at all.

Any clues?

Thanks in advance

--
Jorge Arevalo
Freelance developer

http://www.krop.com/jorgearevalo
http://about.me/jorgeas80


More information about the gdal-dev mailing list