Returns a (buffered) land mask to constrain potential model results.
stk_mask(buffer = 0, resolution = 1, bbox, sf = FALSE)
The buffer distance from land areas (in km, default = 0 excluding all water bodies).
The resolution of the spatial grid in degrees, when exporting as a terra SpatRaster (default = 1).
A bounding box of the mask to constrain the estimated location parameter space.
Return the land mask as an 'sf' polygon, not a rasterized map for. use in map plotting, not used for processing (default = FALSE)
A buffered land mask as an 'sf' or 'terra' map object.
if (FALSE) { # \dontrun{
# define land mask with a bounding box
# and an off-shore buffer (in km), in addition
# you can specifiy the resolution of the resulting raster
mask <- stk_mask(
bbox = c(-20, -40, 60, 60), #xmin, ymin, xmax, ymax
buffer = 150, # in km
resolution = 0.5 # map grid in degrees
)
} # }