Functions to ascertain the binary relationship between two geometry vectors. Binary predicates are provided both pairwise as a sparse matrix.
Usage
intersects_sparse(x, y)
intersects_pairwise(x, y)
contains_sparse(x, y)
contains_pairwise(x, y)
within_sparse(x, y)
within_pairwise(x, y)
Value
For
_sparse
a list of integer vectors containing the position of the geometry iny
For
_pairwise
a logical vector
Examples
if (rlang::is_installed("sf")) {
nc <- sf::st_read(
system.file("shape/nc.shp", package = "sf"),
quiet = TRUE
)
x <- as_rsgeo(nc$geometry[1:5])
y <- rev(x)
# intersects
intersects_sparse(x, y)
intersects_pairwise(x, y)
# contains
contains_sparse(x, y)
contains_pairwise(x, y)
# within
within_sparse(x, y)
within_pairwise(x, y)
}
#> [1] FALSE FALSE TRUE FALSE FALSE