as_network {rcrisp} | R Documentation |
Create a network from a collection of line strings.
Description
Create a network from a collection of line strings.
Usage
as_network(edges, flatten = TRUE, clean = TRUE)
Arguments
edges |
A data frame with the network edges |
flatten |
Whether all intersections between edges should be converted to nodes |
clean |
Whether general cleaning tasks should be run on the generated
network (see |
Value
A spatial network object
Examples
edges <- sf::st_sfc(
sf::st_linestring(matrix(c(0, 0, 1, 1), ncol = 2, byrow = TRUE)),
sf::st_linestring(matrix(c(0, 1, 1, 0), ncol = 2, byrow = TRUE))
)
sf::st_crs(edges) <- sf::st_crs("EPSG:4326")
as_network(edges)
[Package rcrisp version 0.1.4 Index]