rasterize_polygons {exactextractr} | R Documentation |
Create a raster approximation of a polygon coverage
Description
Returns a raster whose values indicate the index of the polygon covering
each cell. Where multiple polygons cover the same cell, the index of the
polygon covering the greatest area will be used, with the lowest index
returned in the case of ties. Cells that are not covered by any polygon,
or whose total covered fraction is less than min_coverage
, will be
set to NA
.
Usage
## S4 method for signature 'sf,RasterLayer'
rasterize_polygons(x, y, min_coverage = 0)
## S4 method for signature 'sf,SpatRaster'
rasterize_polygons(x, y, min_coverage = 0)
Arguments
x |
a |
y |
a (possibly empty) |
min_coverage |
minimum fraction of a cell that must be covered by polygons to be included in the output |
Value
a RasterLayer
or SpatRaster
, consistent with the type of y
[Package exactextractr version 0.10.0 Index]