Identify geometries that are near to each other. Either get the index of all geometries within a cetain distance, or get the k nearest neighbors.
Usage
# S4 method for SpatVector
near(x, distance=0, k=1, centroids=TRUE, symmetrical=TRUE)
Arguments
x
SpatVector
distance
numeric. maximum distance
k
postive integer. number of neighbors. Ignored of distance > 0
centroids
logical. Should the centroids of polygons be used?
symmetrical
logical. If TRUE, a near pair is only included once. That is, if geometry 1 is near to geometry 3, the implied nearness between 3 and 1 is not reported