| graph_to_shp | R Documentation |
The function enables to export a spatial graph to shapefile layers.
graph_to_shp(
graph,
crds,
mode = "both",
crds_crs,
layer,
dir_path,
metrics = FALSE
)
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) |
Note that exporting shapefile layers can limit the number of digits
you can include in numeric fields, as well as the length of column names.
Column names are renamed to allow the export but the number of digits can
generate errors. You are strongly encouraged to use graph_to_gpkg() in
the latter case.
Create shapefile layers in the directory specified with the parameter 'dir_path'.
P. Savary
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.