autoCreateWarpedVRT | R Documentation |
autoCreateWarpedVRT()
creates a warped virtual dataset representing the
input raster warped into a target coordinate system. The output virtual
dataset will be "north-up" in the target coordinate system. GDAL
automatically determines the bounds and resolution of the output virtual
raster which should be large enough to include all the input raster.
Wrapper of GDALAutoCreateWarpedVRT()
in the GDAL Warper API.
autoCreateWarpedVRT(
src_ds,
dst_wkt,
resample_alg,
src_wkt = "",
max_err = 0,
alpha_band = FALSE
)
src_ds |
An object of class |
dst_wkt |
WKT string specifying the coordinate system to convert to.
If empty string ( |
resample_alg |
Character string specifying the sampling method to use. One of NearestNeighbour, Bilinear, Cubic, CubicSpline, Lanczos, Average, RMS or Mode. |
src_wkt |
WKT string specifying the coordinate system of the source raster. If empty string it will be read from the source raster (the default). |
max_err |
Numeric scalar specifying the maximum error measured in
input pixels that is allowed in approximating the transformation ( |
alpha_band |
Logical scalar, |
An object of class GDALRaster
for the new virtual dataset. An
error is raised if the operation fails.
The returned dataset will have no associated filename for itself. If you
want to write the virtual dataset to a VRT file, use the
$setFilename()
method on the returned GDALRaster
object to assign a
filename before it is closed.
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
ds <- new(GDALRaster, elev_file)
ds2 <- autoCreateWarpedVRT(ds, epsg_to_wkt(5070), "Bilinear")
ds2$info()
## set filename before close if a VRT file is needed for the virtual dataset
# ds2$setFilename("/path/to/file.vrt")
ds2$close()
ds$close()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.