wiki:UserDocs/GdalMerge

Version 4 (modified by maphew, 16 years ago) ( diff )

How to merge 3 greyscale to a single RGB image

The gdal_merge utility

A python script to mosaic a set of images The official documentation for gdal_merge is at http://www.gdal.org/gdal_merge.html.

gdal_merge.py uses nearest neighbour resampling. If you want control over the resampling used, you should use gdalwarp instead.

Are there other ways of getting a list of images into gdal_merge without putting them all on the command line?

Method 1, use --optfile The text file is a directory list created in Windows by typing dir /b /s *.tif > 31_input_list.txt

python gdal_merge.py -n 0 -v -o mosaic_31.tif --optfile 31_input_list.txt

Method 2, use a batch file wrapper, see attached. (for windows)

Create an RGB image by merging 3 different greyscale bands

Conduct "merging by stacking" with the -separate flag. So if you had three greyscale files that cover the same area and you do:

gdal_merge.py -separate 1.tif 2.tif 3.tif -o rgb.tif

This maps 1.tif to red, 2.tif to green and 3.tif to blue.

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.