View source: R/tar_terra_tiles.R
set_window | R Documentation |
Create a new SpatRaster object as specified by a window (area of interest)
over the original SpatRaster. This is a wrapper around terra::window()
which, rather than modifying the SpatRaster in place, returns a new
SpatRaster leaving the original unchanged.
set_window(raster, window)
raster |
a SpatRaster object. |
window |
a SpatExtent object defining the area of interest. |
SpatRaster
While this may have general use, it was created primarily for use
within tar_terra_tiles()
.
Eric Scott
f <- system.file("ex/elev.tif", package="terra")
r <- terra::rast(f)
e <- terra::ext(c(5.9, 6,49.95, 50))
r2 <- set_window(r, e)
terra::ext(r)
terra::ext(r2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.