extract_blocks: Extract values from 'raster::Raster' objects that are covered...

Description Usage Arguments Value See Also

View source: R/Spatial_Functions.R

Description

A cell is covered if its center is inside the polygon (but see the weights option for considering partly covered cells).

Usage

1

Arguments

x

Raster* object

y

A matrix with four columns: “xmin”, “xmax”, “ymin”, “ymax”; each row represents the corners of an raster::Extent object.

weights

logical. If TRUE and normalizeWeights=FALSE, the function returns, for each polygon, a matrix with the cell values and the approximate fraction of each cell that is covered by the polygon(rounded to 1/100). If TRUE and normalizeWeights=TRUE the weights are normalized such that they add up to one. The weights can be used for averaging; see examples. This option can be useful (but slow) if the polygons are small relative to the cells size of the Raster* object

Value

A list with one item for each extent of y. Each element is a matrix where each row corresponds to one of the cells of x contained in a sp::SpatialPolygons and where columns correspond to layers of x. If weights is TRUE, then an additional last column is added which contains the weights of the rows.

See Also

extract


Burke-Lauenroth-Lab/rSFSW2 documentation built on Aug. 14, 2020, 5:20 p.m.