st_nb_delaunay {sfdep} | R Documentation |
Graph based neighbors
Description
Create graph based neighbors on a set of points.
Usage
st_nb_delaunay(geometry, .id = NULL)
st_nb_gabriel(geometry, .nnmult = 3)
st_nb_relative(geometry, .nnmult = 3)
Arguments
geometry |
an object of class sfc. If polygons are used, points are generated using |
.id |
default |
.nnmult |
default 3. Used for memory scalling. See |
Details
-
st_nb_delaunay()
usesspdep::tri2nb()
-
st_nb_gabriel()
usesspdep::gabrielneigh()
andspdep::graph2nb()
-
st_nb_relative()
usesspdep::relativeneigh()
andspdep::graph2nb()
st_nb_delaunay()
implements Delaunay triangulation via spdep
and thus via deldir
. Delaunay triangulation creates a mesh of triangles that connects all points in a set. It ensures that no point is in in the circumcircle of an triangle in the triangulation. As a result, Delaunay triangulation maximizes the minimum angle in each triangle consequently avoiding skinny triangles.
The Gabriel graph is a subgraph of the Delaunay triangulation. Edges are created when the closed disc between two points p, and q, contain no other points besides themselves.
The relative neighborhood graph (RNG) is based on the Delaunay triangulation. It connects two points when there are no other closer points to each of them. The RNG is a subgraph of the Delaunay triangulation.
Note that Delaunay triangulation assumes a plane and thus uses Euclidean distances.
See spdep::gabrielneigh()
for further descriptions of the graph neighbor implementations.
Value
an object of class nb
Examples
geometry <- sf::st_centroid(sf::st_geometry(guerry))
st_nb_delaunay(geometry)
st_nb_gabriel(geometry)
st_nb_relative(geometry)