subdivide_edges: Subdivide edges at interior points

View source: R/subdivide.R

subdivide_edgesR Documentation

Subdivide edges at interior points

Description

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.

Usage

subdivide_edges(x, protect = NULL, all = FALSE, merge = TRUE)

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 to FALSE.

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 to FALSE, 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.


luukvdmeer/sfnetworks documentation built on Nov. 21, 2024, 4:54 a.m.