raster_intersect_sp {geoTS} | R Documentation |
Intersects raster and sp objects
Description
Straightforward application of crop
and
mask
to extract the data in the intersection of
Raster*
and SpatialPolygonsDataframe
objects.
Usage
raster_intersect_sp(
x,
y,
features,
save = FALSE,
dirToSave,
baseName = "x_intersect_y",
format = "GTiff"
)
Arguments
x |
|
y |
|
features |
integer vector. Should some specifying features (polygons) of |
save |
logical. Should the output be saved? Default, |
dirToSave |
character specifying where to save output. Required when |
baseName |
character. What should be the base name of output file? Default,
|
format |
character specifying output file format. See |
Details
When save=TRUE
, writeRaster
is used with
argument datatype=dataType(subset(x,1))
.
Value
An object of class identical to that of argument x
Examples
raster_path = system.file("extdata", "MOD13Q1_NDVI_Mohinora.tif", package = "geoTS")
rasterSTACK <- stack(raster_path)
dir.create(path=paste0(system.file("extdata", package="geoTS"), "/output_raster_inter_sp"),
showWarnings=FALSE)
dirToSave = paste0(system.file("extdata", package="geoTS"), "/output_raster_inter_sp")
raster_intersect_sp(x=rasterSTACK, y=shp_mohinora, save=TRUE, dirToSave=dirToSave,
baseName="mohinora_NDVI_2001")
[Package geoTS version 0.1.8 Index]