vrt: Fix missing raster metadata

View source: R/vrt.R

vrtR Documentation

Fix missing raster metadata

Description

Simple metadata augmentation for raster sources.

Usage

vrt(x, extent = NULL, projection = NULL)

## Default S3 method:
vrt(x, extent = NULL, projection = NULL)

Arguments

x

character string, file, url, GDAL dsn

extent

numeric 'c(xmin, xmax, ymin, ymax)'

projection

character wkt, proj, epsg code

Details

Simple function to add either or both of a raster source extent and projection string.

The attributes from 'extent' as 'source_extent' and/or 'projection' as 'source_projection' are passed directly down to GDAL, via the gdalio_data() function, which hands them on to vapour::vapour_warp_raster() arguments 'source_extent' and 'source_wkt' respectively.

Value

lightly classed character vector, with "vrt_simple", "character"

Examples

vrt("myfile.nc")
vrt("myfile.nc", extent = c(-180, 180, -90, 90))
str(vrt("myfile.nc", extent = c(-180, 180, -90, 90), projection = 4326))

hypertidy/gdalio documentation built on June 15, 2022, 6:45 p.m.