gDefrag (version 0.1)

node.creation: Creating graph nodes

Description

Generates the nodes that are the landscape polygons resulting from the landscape clip by infrastructure network.

Usage

node.creation(land_polyg, value_col, plot = TRUE, 
scale_nodes = 1, col_nodes = "deepskyblue4", cex_labels = 1, 
shape = FALSE, shape_name_nodes = "shape_nodes")

Arguments

land_polyg

SpatialPolygonsDataFrame loaded with readOGR function of the package rgdal (polygon shapefile).

value_col

Which column in the SpatialPolygonsDataFrame has the relevant information on the underlying raster. This information must be retrieved previously using a GIS, if the user wishes to use the method 'value' for prioritizing edges.

plot

Plot the output (TRUE/FALSE).

scale_nodes

Scaling factor to represent the nodes graphically.

col_nodes

Nodes colour.

cex_labels

Font size of the labels.

shape

Create a shapefile with the edges (TRUE/FALSE).

shape_name_nodes

Name of the nodes shapefile to be created (all nodes).

Value

The function returns a SpatialPointsDataFrame with the nodes. The data table of this data frame has the following fields:

  • X - Node latitude.

  • Y - Node longitude.

  • pol_value - Underlying raster value summed for each polygon.

  • pol_area - Polygon area.

Details

If shape = TRUE, this function produces one shapefile with all the nodes.

See Also

edge.creation

Examples

Run this code
# NOT RUN {
data(road_P)

out1 <- node.creation(land_polyg = road_P, value_col = "forest_sum", 
scale_nodes = 10, col_nodes = "pink", cex_labels = 1)

# }

Run the code above in your browser using DataLab