The arcs are shared boundaries or standalone boundaries from polygons.
sf_arcnode(x)
x | sf polygons |
---|
sf object of LINESTRING
The feature identity is stored in a list of data frames (the row id of the input feature).
Create lines from shared boundaries between polygons. A single copy of a shared boundary is created as 'sf' lines, keeping the row identity of the input polygon/s. It's expected that polygons have clean neighbour boundaries and don't overlap.
f <- system.file("gpkg/nc.gpkg", package = "sf", mustWork = TRUE) sfx <- sf::read_sf(f) arcs <- sf_arcnode(sfx) plot(arcs["arc"], col = sample(hcl.colors(nrow(arcs))))s <- sample(seq_len(dim(sfx)[1L]), 1L) plot(sfx[arcs$feature_ids[[s]]$row, 1], reset = FALSE, col = c("grey", "grey10"))#> Warning: col is not of length 1 or nrow(x): colors will be recycled; use pal to specify a color palette