Raster mask by union of buffers around xy positions
raster_xy_mask.Rd
creates a raster mask by union of circular buffers around xy positions
Examples
# create raster
r <- terra::rast(xmin=0, xmax = 40, ymin = 0, ymax = 40, resolution = 1, crs= NA )
# xy positions
xy <- data.frame(
x = c(10, 20, 31.25, 15),
y = c(10, 20, 31.25, 25)
)
# compute mask
mask1 <- raster_xy_mask(xy, c(5, 8, 5, 5), r)
mask2 <- raster_xy_mask(xy, c(5, 8, 5, 5), r, binary = FALSE)
# display binary raster
terra::plot(mask1)
graphics::points(xy)
# display distance raster
terra::plot(mask2)
graphics::points(xy)