View source: R/check_topology.R
st_check_crossings | R Documentation |
Check if some roads are crossing elsewhere than at their ends. These occurences should be fixed as roads crossing each other should be split at their intersection point in a valid topological network.
st_check_crossings(roads)
roads |
multiples lines ( |
Point object (sf
format) corresponding to intersection points of crossing roads.
library(sf)
network <- system.file("extdata", "j53e_network.gpkg", package="ALSroads")
network <- st_read(network, "invalid_topology")
crossings <- st_check_crossings(network)
par(mfrow=c(1,2))
plot(st_geometry(network), axes = TRUE) # Inspected roads
plot(crossings, col = "blue", add = TRUE) # Crossings to fix
title("Full extent")
plot(st_geometry(network), axes = TRUE, xlim = c(260891, 260892), ylim=c(5250599, 5250599.5))
plot(crossings, col = "blue", add = TRUE)
title("Zoom at crossings")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.