Description Usage Arguments Details Value See Also Examples
This function crops or extends the extent of a raster to the extent of a reference. Some cells of the reference raster can optionally be masked based on their values.
1 2 3 4 5 6 7 8 9 | matchExtent(
x,
ref,
mask = FALSE,
inverse = FALSE,
maskValue = NA,
filename = "",
...
)
|
x |
Raster* object or list of Raster* objects. |
ref |
Raster* object. |
mask |
Logical. Should x be masked by |
inverse |
Logical. If TRUE, cells of |
maskValue |
Value of |
filename |
Character. Output file name including path to directory and
eventually extension. If |
... |
Other arguments passed to |
x
and ref
need to have the same CRS, spatial resolution and
origin. If this is not the case, you can use
matchResolution
before matchExtent
.
Raster* object or list of Raster* objects.
1 2 3 4 5 6 7 8 | # Load raster package
library(raster)
# Open ALS p95 and mask of forested areas as Raster objects
BAP_2006 <- stack(system.file("extdata/examples/Landsat_BAP_2006.tif",package="foster"))
mask_forest <- raster(system.file("extdata/examples/VLCE_forest_2008.tif",package="foster"))
matchExtent(BAP_2006, mask_forest, mask = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.