nh_burn | R Documentation |
Takes spatial features, a continuous raster (values between 0 and 1), and
returns a classified binary (0/1) raster. Areas intersecting spf
features
are assigned a value of 1 in the returned classified raster. Additionally, areas
within buffer
distance of spf
and above the threshold are set to 1.
See details for default calculation of orig.thresh
and usage of buffer
.
nh_burn(spf, rast, orig.thresh = NULL, buffer = NA, return.thresh = FALSE)
spf |
input spatial features (sp or sf spatial object) |
rast |
input raster model output (values between 0 and 1) |
orig.thresh |
numeric between 0 and 1; threshold value to apply to raster |
buffer |
numeric; spatial buffer distance around spf where threshold will be applied. |
return.thresh |
logical; whether to return thresholds along with raster in a list |
When buffer
is used or orig.thresh
is not provided,
a minimum cell value (min.cell) of values within spf
is calculated and
used as the threshold.
The default is to return the raster only. If return.thresh = TRUE
, the function will
return a list with 3 named objects: rast
, the output raster; orig.thresh
,
the global threshold (if used); min.cell
, the minimum cell value threshold (if used).
SpatRaster
David Bucklin
## Not run:
spf <- sf::st_read("_data/occurrence/ambymabe.shp")
rast <- terra::rast("_data/species/ambymabe/outputs/model_predictions/ambymabe_20171018_130837.tif")
full_burn <- nh_burn(spf, rast, buffer = NA)
buff_burn <- nh_burn(spf, rast, buffer = 10000)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.