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] output.vrt [gdalfile]*
21

DESCRIPTION

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

EXAMPLES

186       • Make a virtual mosaic from all TIFF files contained in a directory :
187
188          gdalbuildvrt doq_index.vrt doq/*.tif
189
190       • Make  a  virtual  mosaic from files whose name is specified in a text
191         file :
192
193          gdalbuildvrt -input_file_list my_list.txt doq_index.vrt
194
195       • Make a RGB virtual mosaic from 3 single-band input files :
196
197          gdalbuildvrt -separate rgb.vrt red.tif green.tif blue.tif
198
199       • Make a virtual mosaic with blue background colour (RGB: 0 0 255) :
200
201          gdalbuildvrt -hidenodata -vrtnodata "0 0 255" doq_index.vrt doq/*.tif
202

AUTHOR

204       Even Rouault <even.rouault@spatialys.com>
205
207       1998-2021
208
209
210
211
212                                 Sep 07, 2021                  GDALBUILDVRT(1)
Impressum