st_nb_delaunay | R Documentation |
Create graph based neighbors on a set of points.
st_nb_delaunay(geometry, .id = NULL)
st_nb_gabriel(geometry, .nnmult = 3)
st_nb_relative(geometry, .nnmult = 3)
geometry |
an object of class sfc. If polygons are used, points are generated using |
.id |
default |
.nnmult |
default 3. Used for memory scalling. See |
st_nb_delaunay()
uses spdep::tri2nb()
st_nb_gabriel()
uses spdep::gabrielneigh()
and spdep::graph2nb()
st_nb_relative()
uses spdep::relativeneigh()
and spdep::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.
an object of class nb
geometry <- sf::st_centroid(sf::st_geometry(guerry))
st_nb_delaunay(geometry)
st_nb_gabriel(geometry)
st_nb_relative(geometry)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.