nearby geometries
Identify geometries that are near to each other. Either get the index of all geometries within a certain distance, or the k nearest neighbors, or (with nearest
) get closest points between two geometries.
## S4 method for signature 'SpatVector' nearby(x, distance=0, k=1, centroids=TRUE, symmetrical=TRUE) ## S4 method for signature 'SpatVector' nearest(x, y, pairs=FALSE, centroids=TRUE, lines=FALSE)
x |
SpatVector |
y |
SpatVector |
distance |
numeric. maximum distance |
k |
positive integer. number of neighbors. Ignored if |
centroids |
logical. Should the centroids of polygons be used? |
symmetrical |
logical. If |
pairs |
logical. If |
lines |
logical. If |
matrix
f <- system.file("ex/lux.shp", package="terra") v <- vect(f) nearby(v, distance=12000)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.