Suggest Edges to Connect Two Sides of a Border

seam_sew(shp, admin, seam, epsg = 3857)

Arguments

shp

sf tibble where admin column is found

admin

quoted name of administrative unit column

seam

administrative units to filter by

epsg

numeric EPSG code to planarize to. Default is 3857.

Value

tibble of edges connecting sides of a border

Examples

data('rockland')
data('orange')
data('nrcsd')

o_and_r <- rbind(orange, rockland)
o_and_r <- o_and_r |>
  geo_filter(nrcsd) |>
  geo_trim(nrcsd)
adj <- adjacency(o_and_r)

adds <- seam_sew(o_and_r, 'county', c('071', '087'))
adj <- adj |> add_edge(adds$v1, adds$v2)