graph_to_shp {graph4lg} | R Documentation |
Export a spatial graph to shapefile layers
Description
The function enables to export a spatial graph to shapefile layers.
Usage
graph_to_shp(
graph,
crds,
mode = "both",
crds_crs,
layer,
dir_path,
metrics = FALSE
)
Arguments
graph |
A graph object of class |
crds |
(if 'mode = 'spatial”) A
|
mode |
Indicates which shapefile layers will be created
|
crds_crs |
An integer indicating the EPSG code of the coordinates reference system to use. The projection and datum are given in the PROJ.4 format. |
layer |
A character string indicating the suffix of the name of the layers to be created. |
dir_path |
A character string corresponding to the path to the directory
in which the shapefile layers will be exported. If |
metrics |
(not considered if 'mode = 'link”) Logical. Should graph node attributes integrated in the attribute table of the node shapefile layer? (default: FALSE) |
Value
Create shapefile layers in the directory specified with the parameter 'dir_path'.
Author(s)
P. Savary
Examples
## Not run:
data(data_tuto)
mat_w <- data_tuto[[1]]
gp <- gen_graph_topo(mat_w = mat_w, topo = "gabriel")
crds_crs <- 2154
crds <- pts_pop_simul
layer <- "graph_dps_gab"
graph_to_shp(graph = gp, crds = pts_pop_simul, mode = "both",
crds_crs = crds_crs,
layer = "test_fonct",
dir_path = tempdir(),
metrics = FALSE)
## End(Not run)