regionalize | R Documentation |
This offers a basic method for dividing a shape into separate pieces
regionalize(shp, lines, adj = adjacency(shp), epsg = 3857)
shp |
|
lines |
|
adj |
adjacency graph |
epsg |
numeric EPSG code to planarize to. Default is 3857. |
integer vector of regions with nrow(shp)
entries
data(towns)
# make some weird roadlike feature passing through the towns
lines <- sf::st_sfc(sf::st_linestring(sf::st_coordinates(sf::st_centroid(towns))),
crs = sf::st_crs(towns)
)
regionalize(towns, lines)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.