gdalbuildvrt: Interface to GDAL's gdalbuildvrt utility

View source: R/gdalbuildvrt.R

gdalbuildvrtR Documentation

Interface to GDAL's gdalbuildvrt utility

Description

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). If TRUE, instead of executing the requested call to GDAL, the function will print the command-line call that would produce the equivalent output.

Value

Silently returns path to output.vrt.

Author(s)

Joshua O'Brien

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)

gdalUtilities documentation built on Aug. 10, 2023, 5:08 p.m.