Clip input vector by the expected maximum extent of computation.
Arguments
- pnts
sf
orSpatVector
object- radius
numeric(1)
. Circular buffer radius. this value will be automatically multiplied by 1.1- target_input
sf
orSpatVector
object to be clipped
See also
Other Helper functions:
any_class_args()
,
clip_ras_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(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
library(stars)
#> Loading required package: abind
library(terra)
options(sf_use_s2 = FALSE)
bcsd_path <- system.file(package = "stars", "nc/bcsd_obs_1999.nc")
bcsd <- stars::read_stars(bcsd_path)
#> pr, tas,
bcsd <- sf::st_as_sf(bcsd)
bcsd_rpnt <- sf::st_as_sf(sf::st_sample(bcsd, 4L))
bcsd_rpntm <- sf::st_as_sf(sf::st_sample(bcsd, 1000L))
clip_vec_ext(bcsd_rpntm, 1000, bcsd_rpnt)
#> Clip target features with the input feature extent...
#> Simple feature collection with 4 features and 0 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: -82.93117 ymin: 33.02974 xmax: -77.41361 ymax: 34.6201
#> CRS: NA
#> x
#> 1 POINT (-81.62004 34.58888)
#> 2 POINT (-77.41361 34.6201)
#> 3 POINT (-82.93117 33.02974)
#> 4 POINT (-80.22347 34.50031)