Overlay a SpatialPolygonsDataFrame or sf polygons layer on a raster layer and clip the raster to each polygon. Optionally done in parallel
Source:R/raster_by_poly.R
raster_by_poly.Rd
Overlay a SpatialPolygonsDataFrame or sf polygons layer on a raster layer and clip the raster to each polygon. Optionally done in parallel
Arguments
- raster_layer
the raster layer
- poly
a
SpatialPolygonsDataFrame
layer orsf
layer- poly_field
the field on which to split the
SpatialPolygonsDataFrame
- summarize
Should the function summarise the raster values in each polygon to a vector? Default
FALSE
- parallel
process in parallel? Default
FALSE
. IfTRUE
, it is up to the user to callfuture::plan()
(or set options) to specify what parallel strategy to use.