Construct a subdivision of the network by subdividing edges at interior points. Subdividing means that a new node is added on an edge, and the edge is split in two at that location. Interior points are those points that shape a linestring geometry feature but are not endpoints of it.
Arguments
- x
An object of class
sfnetwork
with spatially explicit edges.- protect
An integer vector of edge indices specifying which edges should be protected from being subdivided. Defaults to
NULL
, meaning that none of the edges is protected.- all
Should edges be subdivided at all their interior points? If set to
FALSE
, edges are only subdivided at those interior points that share their location with any other interior or boundary point (a node) in the edges table. Defaults toFALSE
.- merge
Should multiple subdivision points at the same location be merged into a single node, and should subdivision points at the same location as an existing node be merged into that node? Defaults to
TRUE
. If set toFALSE
, each subdivision point is added separately as a new node to the network.
Value
The subdivision of x as object of class sfnetwork
.
Note
By default sfnetworks rounds coordinates to 12 decimal places to
determine spatial equality. You can influence this behavior by explicitly
setting the precision of the network using
st_set_precision
.