make_edges_valid | R Documentation |
This function makes invalid edges valid by modifying either edge or node geometries such that the boundary points of edge linestring geometries always match the point geometries of the nodes that are specified as their incident nodes by the *from* and *to* columns.
make_edges_valid(x, preserve_geometries = FALSE)
x |
An object of class |
preserve_geometries |
Should the edge geometries remain unmodified?
Defaults to |
If geometries should be preserved, edges are made valid by adding
edge boundary points that do not equal their corresponding node geometry as
new nodes to the network, and updating the *from* and *to* indices to match
this newly added nodes. If FALSE
, edges are made valid by modifying
their geometries, i.e. edge boundary points that do not equal their
corresponding node geometry are replaced by that node geometry.
An object of class sfnetwork
with corrected edge
geometries.
This function works only if the edge geometries are meant to start at
their specified *from* node and end at their specified *to* node. In
undirected networks this is not necessarily the case, since edge geometries
are allowed to start at their specified *to* node and end at their specified
*from* node. Therefore, in undirected networks those edges first have to be
reversed before running this function. Use
make_edges_follow_indices
for this.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.