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                      [-optim {[AUTO]/VECTOR/RASTER}]
15                      [-addalpha] [-hidenodata]
16                      [-srcnodata "value [value...]"] [-vrtnodata "value [value...]"]
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       -b <band>
118              Select an input <band> to be processed. Bands are numbered  from
119              1.  If input bands not set all bands will be added to vrt.  Mul‐
120              tiple -b switches may be used to select a set of input bands.
121
122       -sd< <subdataset>
123              If the input dataset contains several  subdatasets  use  a  sub‐
124              dataset  with the specified number (starting from 1). This is an
125              alternative of giving the full subdataset name as an input.
126
127       -vrtnodata <value> [<value>...]
128              Set nodata values at the VRT band level (different values can be
129              supplied for each band).  If more than one value is supplied all
130              values should be quoted to keep them together as a single  oper‐
131              ating  system argument.  If the option is not specified, intrin‐
132              sic nodata settings on the first dataset will be used  (if  they
133              exist).  The  value  set  by  this  option is written in the No‐
134              DataValue element of each VRTRasterBand element. Use a value  of
135              None to ignore intrinsic nodata settings on the source datasets.
136
137       -separate
138              Place  each  input file into a separate band. In that case, only
139              the first band of each dataset will be placed into a  new  band.
140              Contrary  to the default mode, it is not required that all bands
141              have the same datatype.
142
143       -allow_projection_difference
144              When this option is specified, the utility will accept to make a
145              VRT  even  if  the  input datasets have not the same projection.
146              Note: this does not mean that they will  be  reprojected.  Their
147              projection will just be ignored.
148
149       -optim {[AUTO]/VECTOR/RASTER}}
150              Force  the  algorithm  used  (results are identical). The raster
151              mode is used in most cases and optimise  read/write  operations.
152              The vector mode is useful with a decent amount of input features
153              and optimise the CPU use. That mode have to be used  with  tiled
154              images  to  be efficient. The auto mode (the default) will chose
155              the algorithm based on input and output properties.
156
157              New in version 2.3.
158
159
160       -a_srs <srs_def>
161              Override the projection for the output file.  The <srs_def>  may
162              be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n
163              or a file containing the WKT. No reprojection is done.
164
165       -r {nearest (default),bilinear,cubic,cubicspline,lanczos,average,mode}
166              Select a resampling algorithm.
167
168       -oo NAME=VALUE
169              Dataset open option (format specific)
170
171              New in version 2.2.
172
173
174       -input_file_list <mylist.txt>
175              To specify a text file with an input filename on each line
176
177       -q     To disable the progress bar on the console
178
179       -overwrite
180              Overwrite the VRT if it already exists.
181

EXAMPLES

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

AUTHOR

201       Even Rouault <even.rouault@spatialys.com>
202
204       1998-2021
205
206
207
208
209                                 Mar 24, 2021                  GDALBUILDVRT(1)
Impressum