1GDALBUILDVRT(1) GDAL GDALBUILDVRT(1)
2
3
4
6 gdalbuildvrt - Builds a VRT from a list of datasets.
7
9 gdalbuildvrt [-tileindex field_name]
10 [-resolution {highest|lowest|average|user}]
11 [-te xmin ymin xmax ymax] [-tr xres yres] [-tap]
12 [-separate] [-b band]* [-sd subdataset]
13 [-allow_projection_difference] [-q]
14 [-addalpha] [-hidenodata]
15 [-srcnodata "value [value...]"] [-vrtnodata "value [value...]"]
16 [-ignore_srcmaskband]
17 [-a_srs srs_def]
18 [-r {nearest,bilinear,cubic,cubicspline,lanczos,average,mode}]
19 [-oo NAME=VALUE]*
20 [-input_file_list my_list.txt] [-overwrite]
21 [-strict | -non_strict]
22 output.vrt [gdalfile]*
23
25 This program builds a VRT (Virtual Dataset) that is a mosaic of the
26 list of input GDAL datasets. The list of input GDAL datasets can be
27 specified at the end of the command line, or put in a text file (one
28 filename per line) for very long lists, or it can be a MapServer
29 tileindex (see ref gdaltindex utility). In the later case, all entries
30 in the tile index will be added to the VRT.
31
32 With -separate, each files goes into a separate band in the VRT
33 dataset. Otherwise, the files are considered as tiles of a larger mo‐
34 saic and the VRT file has as many bands as one of the input files.
35
36 If one GDAL dataset is made of several subdatasets and has 0 raster
37 bands, all the subdatasets will be added to the VRT rather than the
38 dataset itself.
39
40 gdalbuildvrt does some amount of checks to assure that all files that
41 will be put in the resulting VRT have similar characteristics : number
42 of bands, projection, color interpretation... If not, files that do not
43 match the common characteristics will be skipped. (This is only true
44 in the default mode, and not when using the -separate option)
45
46 If there is some amount of spatial overlapping between files, the order
47 of files appearing in the list of source matter: files that are listed
48 at the end are the ones from which the content will be fetched. Note
49 that nodata will be taken into account to potentially fetch data from
50 less priority datasets, but currently, alpha channel is not taken into
51 account to do alpha compositing (so a source with alpha=0 appearing on
52 top of another source will override is content). This might be changed
53 in later versions.
54
55 -tileindex
56 Use the specified value as the tile index field, instead of the
57 default value which is 'location'.
58
59 -resolution {highest|lowest|average|user}
60 In case the resolution of all input files is not the same, the
61 -resolution flag enables the user to control the way the output
62 resolution is computed.
63
64 highest will pick the smallest values of pixel dimensions within
65 the set of source rasters.
66
67 lowest will pick the largest values of pixel dimensions within
68 the set of source rasters.
69
70 average is the default and will compute an average of pixel di‐
71 mensions within the set of source rasters.
72
73 user must be used in combination with the -tr option to specify
74 the target resolution.
75
76 -tr <xres> <yres>
77 Set target resolution. The values must be expressed in georefer‐
78 enced units. Both must be positive values. Specifying those
79 values is of course incompatible with highest|lowest|average
80 values for -resolution option.
81
82 -tap (target aligned pixels) align the coordinates of the extent of
83 the output file to the values of the -tr, such that the aligned
84 extent includes the minimum extent. Alignment means that xmin /
85 resx, ymin / resy, xmax / resx and ymax / resy are integer val‐
86 ues.
87
88 -te xmin ymin xmax ymax
89 Set georeferenced extents of VRT file. The values must be ex‐
90 pressed in georeferenced units. If not specified, the extent of
91 the VRT is the minimum bounding box of the set of source
92 rasters.
93
94 -addalpha
95 Adds an alpha mask band to the VRT when the source raster have
96 none. Mainly useful for RGB sources (or grey-level sources).
97 The alpha band is filled on-the-fly with the value 0 in areas
98 without any source raster, and with value 255 in areas with
99 source raster. The effect is that a RGBA viewer will render the
100 areas without source rasters as transparent and areas with
101 source rasters as opaque. This option is not compatible with
102 -separate.
103
104 -hidenodata
105 Even if any band contains nodata value, giving this option makes
106 the VRT band not report the NoData. Useful when you want to con‐
107 trol the background color of the dataset. By using along with
108 the -addalpha option, you can prepare a dataset which doesn't
109 report nodata value but is transparent in areas with no data.
110
111 -srcnodata <value> [<value>...]
112 Set nodata values for input bands (different values can be sup‐
113 plied for each band). If more than one value is supplied all
114 values should be quoted to keep them together as a single oper‐
115 ating system argument. If the option is not specified, the in‐
116 trinsic nodata settings on the source datasets will be used (if
117 they exist). The value set by this option is written in the NO‐
118 DATA element of each ComplexSource element. Use a value of None
119 to ignore intrinsic nodata settings on the source datasets.
120
121 -ignore_srcmaskband
122 New in version 3.3.
123
124
125 Starting with GDAL 3.3, if a source has a mask band (inter‐
126 nal/external mask band, or alpha band), a <ComplexSource> ele‐
127 ment is created by default with a <UseMaskBand>true</Use‐
128 MaskBand> child element, to instruct the VRT driver to use the
129 mask band of the source to mask pixels being composited. This is
130 a generalization of the NODATA element. When specifying the
131 -ignore_srcmaskband option, the mask band of sources will not be
132 taken into account, and in case of overlapping between sources,
133 the last one will override previous ones in areas of overlap.
134
135 -b <band>
136 Select an input <band> to be processed. Bands are numbered from
137 1. If input bands not set all bands will be added to vrt. Mul‐
138 tiple -b switches may be used to select a set of input bands.
139
140 -sd< <subdataset>
141 If the input dataset contains several subdatasets use a sub‐
142 dataset with the specified number (starting from 1). This is an
143 alternative of giving the full subdataset name as an input.
144
145 -vrtnodata <value> [<value>...]
146 Set nodata values at the VRT band level (different values can be
147 supplied for each band). If more than one value is supplied all
148 values should be quoted to keep them together as a single oper‐
149 ating system argument. If the option is not specified, intrin‐
150 sic nodata settings on the first dataset will be used (if they
151 exist). The value set by this option is written in the No‐
152 DataValue element of each VRTRasterBand element. Use a value of
153 None to ignore intrinsic nodata settings on the source datasets.
154
155 -separate
156 Place each input file into a separate band. In that case, only
157 the first band of each dataset will be placed into a new band.
158 Contrary to the default mode, it is not required that all bands
159 have the same datatype.
160
161 -allow_projection_difference
162 When this option is specified, the utility will accept to make a
163 VRT even if the input datasets have not the same projection.
164 Note: this does not mean that they will be reprojected. Their
165 projection will just be ignored.
166
167 -a_srs <srs_def>
168 Override the projection for the output file. The <srs_def> may
169 be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n
170 or a file containing the WKT. No reprojection is done.
171
172 -r {nearest (default),bilinear,cubic,cubicspline,lanczos,average,mode}
173 Select a resampling algorithm.
174
175 -oo NAME=VALUE
176 Dataset open option (format specific)
177
178 New in version 2.2.
179
180
181 -input_file_list <mylist.txt>
182 To specify a text file with an input filename on each line
183
184 -q To disable the progress bar on the console
185
186 -overwrite
187 Overwrite the VRT if it already exists.
188
189 -strict
190 Turn warnings as failures. This is mutually exclusive with
191 -non_strict, the latter which is the default.
192
193 New in version 3.4.2.
194
195
196 -non_strict
197 Skip source datasets that have issues with warnings, and con‐
198 tinue processing. This is the default.
199
200 New in version 3.4.2.
201
202
204 • Make a virtual mosaic from all TIFF files contained in a directory :
205
206 gdalbuildvrt doq_index.vrt doq/*.tif
207
208 • Make a virtual mosaic from files whose name is specified in a text
209 file :
210
211 gdalbuildvrt -input_file_list my_list.txt doq_index.vrt
212
213 • Make a RGB virtual mosaic from 3 single-band input files :
214
215 gdalbuildvrt -separate rgb.vrt red.tif green.tif blue.tif
216
217 • Make a virtual mosaic with blue background colour (RGB: 0 0 255) :
218
219 gdalbuildvrt -hidenodata -vrtnodata "0 0 255" doq_index.vrt doq/*.tif
220
222 Even Rouault <even.rouault@spatialys.com>
223
225 1998-2023
226
227
228
229
230 Apr 17, 2023 GDALBUILDVRT(1)