Check if the boundary of the vector/raster object is inside the reference
Source:R/check.R
is_within_ref.Rd
Check if the boundary of the vector/raster object is inside the reference
Arguments
- input_object
sf/stars/SpatVector/SpatRaster object.
- reference
sf/stars/SpatVector/SpatRaster object.
See also
Other Helper functions:
any_class_args()
,
clip_ras_ext()
,
clip_vec_ext()
,
crs_check()
,
datamod()
,
dep_check()
,
dep_switch()
,
ext2poly()
,
get_clip_ext()
,
is_bbox_within_reference()
,
par_def_q()
,
reproject_b2r()
,
reproject_std()
,
vect_valid_repair()
Author
Insang Song geoissong@gmail.com
Examples
library(sf)
sf_use_s2(FALSE)
ncpath <- system.file("shape/nc.shp", package = "sf")
nc <- sf::read_sf(ncpath)
nc <- sf::st_transform(nc, "EPSG:4326")
mainland_vec <- c(xmin = -128, xmax = -62, ymin = 22, ymax = 52)
mainland_box <- ext2poly(mainland_vec, output_class = "sf")
within_res <- is_within_ref(nc, mainland_box)
#> although coordinates are longitude/latitude, st_covered_by assumes that they
#> are planar
within_res
#> [1] TRUE