Hot answers tagged gdal-merge
gdal_merge.py is the correct tool to 'stack' your input images. Assuming that your first band has a valid color table you could use: gdal_merge.py -separate -pct -o output_file.tif file1.tif file2.tif file3.tif Note: The command has been reformatted with -o output_file.tif before the list of inputs. From the docs: -pct: Grab a pseudocolor table ...
The first way I can think of is to build a vrt, edit and translate: gdalbuildvrt -separate output.vrt file1.tif file2.tif file3.tif add the color interp tag where needed: ... <VRTRasterBand dataType="Byte" band="1"> <ColorInterp>Red</ColorInterp> <NoDataValue>255</NoDataValue> <ComplexSource> <SourceFilename ...
I have a solution! It IS because of the old and infuriating GDAL upside-down export to GeoTiff (see my comments above)! Before anybody tells me that this has been fixed - I agree it does appear to be fixed but I was using a mixture of data converted with a older version of GDAL about 4 years ago and data I converted with the latest version of GDAL about 3 ...
While I don't know why GDAL provides this overlap in functionality, be sure to set the cache for gdalwarp to make it really fast: # assuming 3G of cache here: gdalwarp --config GDAL_CACHEMAX 3000 -wm 3000 $(list_of_tiffs) merged.tiff Be sure to not define more cache than having RAM on the machine.
Yes, the two different version of GDAL_merge do behave differently. I ran into a similar problem (see this post), though yours appears to be a little different. Basically, I think that the more recent version is the one to trust. The reason it works differently is because thankfully it has been updated, so it should not be unbelievable.
Only top voted, non community-wiki answers of a minimum length are eligible