1GDALBUILDVRT(1)                      GDAL                      GDALBUILDVRT(1)
2
3
4

NAME

6       gdalbuildvrt - Builds a VRT from a list of datasets.
7

SYNOPSIS

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

DESCRIPTION

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 <res> <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.
85
86       -te xmin ymin xmax ymax
87              Set  georeferenced  extents  of VRT file. The values must be ex‐
88              pressed in georeferenced units.  If not specified, the extent of
89              the  VRT  is  the  minimum  bounding  box  of  the set of source
90              rasters.
91
92       -addalpha
93              Adds an alpha mask band to the VRT when the source  raster  have
94              none.  Mainly  useful  for  RGB sources (or grey-level sources).
95              The alpha band is filled on-the-fly with the value  0  in  areas
96              without  any  source  raster,  and  with value 255 in areas with
97              source raster. The effect is that a RGBA viewer will render  the
98              areas  without  source  rasters  as  transparent  and areas with
99              source rasters as opaque.  This option is  not  compatible  with
100              -separate.
101
102       -hidenodata
103              Even if any band contains nodata value, giving this option makes
104              the VRT band not report the NoData. Useful when you want to con‐
105              trol  the  background  color of the dataset. By using along with
106              the -addalpha option, you can prepare a  dataset  which  doesn't
107              report nodata value but is transparent in areas with no data.
108
109       -srcnodata <value> [<value>...]
110              Set  nodata values for input bands (different values can be sup‐
111              plied for each band). If more than one  value  is  supplied  all
112              values  should be quoted to keep them together as a single oper‐
113              ating system argument. If the option is not specified,  the  in‐
114              trinsic  nodata settings on the source datasets will be used (if
115              they exist). The value set by this option is written in the  NO‐
116              DATA  element of each ComplexSource element. Use a value of None
117              to ignore intrinsic nodata settings on the source datasets.
118
119       -ignore_srcmaskband
120              New in version 3.3.
121
122
123              Starting with GDAL 3.3, if a source  has  a  mask  band  (inter‐
124              nal/external  mask  band, or alpha band), a <ComplexSource> ele‐
125              ment  is  created  by  default  with  a  <UseMaskBand>true</Use‐
126              MaskBand>  child  element, to instruct the VRT driver to use the
127              mask band of the source to mask pixels being composited. This is
128              a  generalization  of  the  NODATA element.  When specifying the
129              -ignore_srcmaskband option, the mask band of sources will not be
130              taken  into account, and in case of overlapping between sources,
131              the last one will override previous ones in areas of overlap.
132
133       -b <band>
134              Select an input <band> to be processed. Bands are numbered  from
135              1.  If input bands not set all bands will be added to vrt.  Mul‐
136              tiple -b switches may be used to select a set of input bands.
137
138       -sd< <subdataset>
139              If the input dataset contains several  subdatasets  use  a  sub‐
140              dataset  with the specified number (starting from 1). This is an
141              alternative of giving the full subdataset name as an input.
142
143       -vrtnodata <value> [<value>...]
144              Set nodata values at the VRT band level (different values can be
145              supplied for each band).  If more than one value is supplied all
146              values should be quoted to keep them together as a single  oper‐
147              ating  system argument.  If the option is not specified, intrin‐
148              sic nodata settings on the first dataset will be used  (if  they
149              exist).  The  value  set  by  this  option is written in the No‐
150              DataValue element of each VRTRasterBand element. Use a value  of
151              None to ignore intrinsic nodata settings on the source datasets.
152
153       -separate
154              Place  each  input file into a separate band. In that case, only
155              the first band of each dataset will be placed into a  new  band.
156              Contrary  to the default mode, it is not required that all bands
157              have the same datatype.
158
159       -allow_projection_difference
160              When this option is specified, the utility will accept to make a
161              VRT  even  if  the  input datasets have not the same projection.
162              Note: this does not mean that they will  be  reprojected.  Their
163              projection will just be ignored.
164
165       -a_srs <srs_def>
166              Override  the projection for the output file.  The <srs_def> may
167              be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n
168              or a file containing the WKT. No reprojection is done.
169
170       -r {nearest (default),bilinear,cubic,cubicspline,lanczos,average,mode}
171              Select a resampling algorithm.
172
173       -oo NAME=VALUE
174              Dataset open option (format specific)
175
176              New in version 2.2.
177
178
179       -input_file_list <mylist.txt>
180              To specify a text file with an input filename on each line
181
182       -q     To disable the progress bar on the console
183
184       -overwrite
185              Overwrite the VRT if it already exists.
186
187       -strict
188              Turn  warnings  as  failures.  This  is  mutually exclusive with
189              -non_strict, the latter which is the default.
190
191              New in version 3.4.2.
192
193
194       -non_strict
195              Skip source datasets that have issues with  warnings,  and  con‐
196              tinue processing. This is the default.
197
198              New in version 3.4.2.
199
200

EXAMPLES

202       • Make a virtual mosaic from all TIFF files contained in a directory :
203
204          gdalbuildvrt doq_index.vrt doq/*.tif
205
206       • Make  a  virtual  mosaic from files whose name is specified in a text
207         file :
208
209          gdalbuildvrt -input_file_list my_list.txt doq_index.vrt
210
211       • Make a RGB virtual mosaic from 3 single-band input files :
212
213          gdalbuildvrt -separate rgb.vrt red.tif green.tif blue.tif
214
215       • Make a virtual mosaic with blue background colour (RGB: 0 0 255) :
216
217          gdalbuildvrt -hidenodata -vrtnodata "0 0 255" doq_index.vrt doq/*.tif
218

AUTHOR

220       Even Rouault <even.rouault@spatialys.com>
221
223       1998-2022
224
225
226
227
228                                 May 04, 2022                  GDALBUILDVRT(1)
Impressum