1GDAL_MERGE(1) GDAL GDAL_MERGE(1)
2
3
4
6 gdal_merge - Mosaics a set of images.
7
9 gdal_merge.py [-o out_filename] [-of out_format] [-co NAME=VALUE]*
10 [-ps pixelsize_x pixelsize_y] [-tap] [-separate] [-q] [-v] [-pct]
11 [-ul_lr ulx uly lrx lry] [-init "value [value...]"]
12 [-n nodata_value] [-a_nodata output_nodata_value]
13 [-ot datatype] [-createonly] input_files
14
16 This utility will automatically mosaic a set of images. All the images
17 must be in the same coordinate system and have a matching number of
18 bands, but they may be overlapping, and at different resolutions. In
19 areas of overlap, the last image will be copied over earlier ones.
20
21 -o <out_filename>
22 The name of the output file, which will be created if it does
23 not already exist (defaults to "out.tif").
24
25 -of <format>
26 Select the output format. Starting with GDAL 2.3, if not speci‐
27 fied, the format is guessed from the extension (previously was
28 GTiff). Use the short format name.
29
30 -co <NAME=VALUE>
31 Many formats have one or more optional creation options that can
32 be used to control particulars about the file created. For in‐
33 stance, the GeoTIFF driver supports creation options to control
34 compression, and whether the file should be tiled.
35
36 The creation options available vary by format driver, and some
37 simple formats have no creation options at all. A list of op‐
38 tions supported for a format can be listed with the --formats
39 command line option but the documentation for the format is the
40 definitive source of information on driver creation options.
41 See raster_drivers format specific documentation for legal cre‐
42 ation options for each format.
43
44 -ot <type>
45 Force the output image bands to have a specific data type sup‐
46 ported by the driver, which may be one of the following: Byte,
47 UInt16, Int16, UInt32, Int32, Float32, Float64, CInt16, CInt32,
48 CFloat32 or CFloat64.
49
50 -ps <pixelsize_x> <pixelsize_y>
51 Pixel size to be used for the output file. If not specified the
52 resolution of the first input file will be used.
53
54 -tap (target aligned pixels) align the coordinates of the extent of
55 the output file to the values of the -tr, such that the aligned
56 extent includes the minimum extent.
57
58 -ul_lr <ulx> <uly> <lrx> <lry>
59 The extents of the output file. If not specified the aggregate
60 extents of all input files will be used.
61
62 -v Generate verbose output of mosaicing operations as they are
63 done.
64
65 -separate
66 Place each input file into a separate band.
67
68 -pct Grab a pseudo-color table from the first input image, and use it
69 for the output. Merging pseudo-colored images this way assumes
70 that all input files use the same color table.
71
72 -n <nodata_value>
73 Ignore pixels from files being merged in with this pixel value.
74
75 -a_nodata <output_nodata_value>
76 Assign a specified nodata value to output bands.
77
78 -init <"value(s)">
79 Pre-initialize the output image bands with these values. How‐
80 ever, it is not marked as the nodata value in the output file.
81 If only one value is given, the same value is used in all the
82 bands.
83
84 -createonly
85 The output file is created (and potentially pre-initialized) but
86 no input image data is copied into it.
87
88 NOTE:
89 gdal_merge.py is a Python script, and will only work if GDAL was
90 built with Python support.
91
93 Create an image with the pixels in all bands initialized to 255.
94
95 % gdal_merge.py -init 255 -o out.tif in1.tif in2.tif
96
97 Create an RGB image that shows blue in pixels with no data. The first
98 two bands will be initialized to 0 and the third band will be initial‐
99 ized to 255.
100
101 % gdal_merge.py -init "0 0 255" -o out.tif in1.tif in2.tif
102
104 Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@inteva‐
105 tion.de>
106
108 1998-2021
109
110
111
112
113 Mar 24, 2021 GDAL_MERGE(1)