Clip input raster by the expected maximum extent of computation.
Arguments
- pnts
sf
orSpatVector
object- radius
numeric(1). buffer radius. This value will be automatically multiplied by 1.25
- ras
SpatRaster
object to be clipped- nqsegs
integer(1)
. the number of points per a quarter circle
See also
Other Helper functions:
any_class_args()
,
clip_vec_ext()
,
crs_check()
,
datamod()
,
dep_check()
,
dep_switch()
,
ext2poly()
,
get_clip_ext()
,
is_bbox_within_reference()
,
is_within_ref()
,
par_def_q()
,
reproject_b2r()
,
reproject_std()
,
vect_valid_repair()
Examples
library(terra)
#> terra 1.7.78
ras_rand <- terra::rast(nrow = 20, ncol = 20)
terra::values(ras_rand) <- runif(400L)
ras_rand_p <-
data.frame(
x = c(3, 5, 3.2, 8),
y = c(12, 10, 15, 12),
z = c(0, 1, 2, 3)
)
ras_rand_p <- terra::vect(ras_rand_p, geom = c("x", "y"))
clip_ras_ext(ras_rand_p, 1.5, ras_rand)
#> class : SpatRaster
#> dimensions : 2, 1, 1 (nrow, ncol, nlyr)
#> resolution : 18, 9 (x, y)
#> extent : 0, 18, 0, 18 (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84
#> source(s) : memory
#> name : lyr.1
#> min value : 0.8666157
#> max value : 0.9528248