View source: R/edge.creation.R
edge.creation | R Documentation |
Generates the graph edges, connecting nodes that are the landscape polygons resulting from the landscape clip by the road network.
edge.creation(nodes, land_polyg, min_length = 0,
min_pol_area = 0, plot = TRUE, shape = FALSE,
shape_name_edges = "shape_edges")
nodes |
Output of the function |
land_polyg |
SpatialPolygonsDataFrame loaded with readOGR function of the package |
min_length |
Minimum length of the road segment to consider creating an edge representing it. |
min_pol_area |
Minimum area for a given polygon to be considered a node. |
plot |
Plot after running? (TRUE/FALSE). |
shape |
Create a shapefile with the edges (TRUE/FALSE). |
shape_name_edges |
Name of the edges shapefile to be created (without prioritization). |
overwrite |
Should the shapefile file be overwritten? |
If shape = TRUE, this function produces one shapefile with edges without prioritization metrics.
The function returns a SpatVector with the edges. The data table of this data frame has the following fields:
node_A - Node A Id.
node_B - Node B Id.
distance - Euclidean distance between nodes A and B (edge length).
x_node_A - Node A longitude.
y_node_A - Node A latitude.
x_node_B - Node B longitude.
y_node_A - Node A latitude.
raster_value_A - Average value of the underlying raster in the polygon represented by node A.
raster_value_B - Average value of the underlying raster in the polygon represented by node B.
road_ID - Id of the road represented by the edge.
road_length - Length of the road represented by the edge.
Frederico Mestre, Fernando Ascensao and A. Marcia Barbosa
node.creation
data(road_P)
#Obtaining nodes
out1 <- node.creation(land_polyg = road_P,
value_col = "frst_sm",
scale_nodes = 10,
cex_labels = 1,
shape = TRUE,
shape_name_nodes = "shape_nodes_file",
overwrite = TRUE)
#Obtaining edges
out2 <- edge.creation(nodes = out1,
land_polyg = road_P,
min_length = 0,
min_pol_area = 0,
shape_name_edges = "shape_edges_file",
shape = TRUE,
overwrite = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.