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)),
crs = sf::st_crs("EPSG:32635")
)
# Run with default values
as_network(edges)
# Only build the spatial network
as_network(edges, flatten = FALSE, clean = FALSE)
Run the code above in your browser using DataLab