create_from_spatial_lines | R Documentation |
Create a spatial network from linestring geometries
create_from_spatial_lines(
x,
directed = TRUE,
compute_length = FALSE,
subdivide = FALSE
)
x |
An object of class |
directed |
Should the constructed network be directed? Defaults to
|
compute_length |
Should the geographic length of the edges be stored in
a column named |
subdivide |
Should the given linestring geometries be subdivided at
locations where an interior point is equal to an interior or boundary point
in another feature? This will connect the features at those locations.
Defaults to |
It is assumed that the given linestring geometries form the edges in the network. Nodes are created at the line boundaries. Shared boundaries between multiple linestrings become the same node.
An object of class sfnetwork
.
By default sfnetworks rounds coordinates to 12 decimal places to
determine spatial equality. You can influence this behavior by explicitly
setting the precision of the linestrings using
st_set_precision
.
create_from_spatial_points
library(sf, quietly = TRUE)
oldpar = par(no.readonly = TRUE)
par(mar = c(1,1,1,1), mfrow = c(1,2))
net = as_sfnetwork(roxel)
net
plot(st_geometry(roxel))
plot(net)
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.