This function provides an interface mirroring that of the GDAL
command-line app gdalbuildvrt
. For a description of the
utility and the arguments that it takes, see the documentation at
https://gdal.org/programs/gdalbuildvrt.html.
Usage
gdalbuildvrt(
gdalfile,
output.vrt,
...,
tileindex,
resolution,
te,
tr,
tap,
separate,
b,
sd,
allow_projection_difference,
optim,
q,
addalpha,
hidenodata,
srcnodata,
vrtnodata,
ignore_srcmaskband,
a_srs,
r,
oo,
input_file_list,
strict,
non_strict,
overwrite,
config_options = character(0),
dryrun = FALSE
)
Arguments
- gdalfile
Character vector supplying file paths to one or more input datasets.
- output.vrt
Character. Path to output VRT file. Typically, output file will have suffix
".vrt"
.- ...
Here, a placeholder argument that forces users to supply exact names of all subsequent formal arguments.
- tileindex, resolution, te, tr, tap, separate, b, sd
See the GDAL project's gdalbuildvrt documentation for details.
- allow_projection_difference, q, optim, addalpha, hidenodata
See the GDAL project's gdalbuildvrt documentation for details.
- srcnodata, vrtnodata, ignore_srcmaskband, a_srs, r, oo
See the GDAL project's gdalbuildvrt documentation for details.
- input_file_list, strict, non_strict, overwrite
See the GDAL project's gdalbuildvrt documentation for details.
- config_options
A named character vector with GDAL config options, of the form
c(option1=value1, option2=value2)
. (See here for a complete list of supported config options.)- dryrun
Logical (default
FALSE
). IfTRUE
, instead of executing the requested call to GDAL, the function will print the command-line call that would produce the equivalent output.
Examples
## Prepare file paths
td <- tempdir()
out_vrt <- file.path(td, "out.vrt")
layer1 <-
system.file("extdata/tahoe_lidar_bareearth.tif",
package = "gdalUtilities")
layer2 <-
system.file("extdata/tahoe_lidar_highesthit.tif",
package = "gdalUtilities")
## Build VRT and check that it works
gdalbuildvrt(gdalfile = c(layer1, layer2), output.vrt = out_vrt)
gdalinfo(out_vrt)
#> Driver: VRT/Virtual Raster
#> Files: /tmp/RtmpdRuzGn/out.vrt
#> /home/runner/work/_temp/Library/gdalUtilities/extdata/tahoe_lidar_bareearth.tif
#> /home/runner/work/_temp/Library/gdalUtilities/extdata/tahoe_lidar_highesthit.tif
#> Size is 400, 400
#> Coordinate System is:
#> GEOGCRS["WGS 84",
#> DATUM["World Geodetic System 1984",
#> ELLIPSOID["WGS 84",6378137,298.257223563,
#> LENGTHUNIT["metre",1]]],
#> PRIMEM["Greenwich",0,
#> ANGLEUNIT["degree",0.0174532925199433]],
#> CS[ellipsoidal,2],
#> AXIS["geodetic latitude (Lat)",north,
#> ORDER[1],
#> ANGLEUNIT["degree",0.0174532925199433]],
#> AXIS["geodetic longitude (Lon)",east,
#> ORDER[2],
#> ANGLEUNIT["degree",0.0174532925199433]],
#> ID["EPSG",4326]]
#> Data axis to CRS axis mapping: 2,1
#> Origin = (-119.932807193230261,39.291413801394071)
#> Pixel Size = (0.000005472861327,-0.000005472861327)
#> Corner Coordinates:
#> Upper Left (-119.9328072, 39.2914138) (119d55'58.11"W, 39d17'29.09"N)
#> Lower Left (-119.9328072, 39.2892247) (119d55'58.11"W, 39d17'21.21"N)
#> Upper Right (-119.9306180, 39.2914138) (119d55'50.22"W, 39d17'29.09"N)
#> Lower Right (-119.9306180, 39.2892247) (119d55'50.22"W, 39d17'21.21"N)
#> Center (-119.9317126, 39.2903192) (119d55'54.17"W, 39d17'25.15"N)
#> Band 1 Block=128x128 Type=Float32, ColorInterp=Gray