View source: R/graphab_habitat.R
| graphab_habitat | R Documentation |
The function creates a new habitat in the Graphab project in two possible ways:
From the raster file defining the project, based on a code value.
From an external vector file (polygon or point type). NOT YET
graphab_habitat(
proj_name,
name,
type = "raster",
rast_codes = NULL,
vec_layer = NULL,
vec_capa_field = NULL,
minarea = 0,
maxsize = NULL,
con8 = FALSE,
parallel.java = NULL,
alloc_ram = NULL,
proj_path = NULL
)
proj_name |
A character string indicating the Graphab project name.
The project name is also the name of the project directory in which the
file proj_name.xml is. It can be created with |
name |
A character string specifying the name (arbitrary) of the new habitat type in the raster project. |
type |
A character string specifying whether the new habitat type is defined from the raster layer defining the project ('type="raster"', default) or from an external vector layer ('type="vector"') of type polygon or point. |
rast_codes |
(default=NULL) If 'type="raster"', code value(s) on the categorical raster layer defining the project corresponding to the type of habitat. Must be an integer or a vector of integer values. |
vec_layer |
A character string indicating the path (absolute or relative) to a vector layer in shapefile (.shp) or geopackage (.gpkg) format. |
vec_capa_field |
(default=NULL) If 'type="vector"', name of the column of the vector layer attribute table setting the capacity of each habitat patch. |
minarea |
(optional, default=0) An integer or numeric value specifiying the minimum area in hectares for a habitat patch size to become a graph node. |
maxsize |
(optional, default=NULL, only if 'type="raster"'). An integer
or numeric value specifying the maximum side length of the rectangular full
extent of each habitat patch in metric units. If this side length exceeds
|
con8 |
(optional, default=FALSE) A logical indicating whether a
neighborhood of 8 pixels (TRUE) is used for patch definition. By default,
|
parallel.java |
An integer indicating how many computer cores are used
to run the .jar file. By default, |
alloc_ram |
(optional, default = NULL) Integer or numeric value indicating RAM gigabytes allocated to the java process. Increasing this value can speed up the computations. Too large values may not be compatible with your machine settings. |
proj_path |
(optional) A character string indicating the path to the
directory that contains the project directory. It should be used when the
project directory is not in the current working directory. Default is NULL.
When 'proj_path = NULL', the project directory is equal to |
A habitat patch consists of the central pixel with its eight neighbors if they are of the same value (8-connexity) and the path geometry is not simplified. See more information in Graphab 3.0 manual: https://thema.umlp.fr/productions/software/graphab/download/manual-3.0-en.pdf
P. Savary, T. Rudolph
foltete2012softwaregraph4lg \insertReffoltete2021graphabgraph4lg \insertRefsavary2024multiplegraph4lg
## Not run:
proj_name <- "graphab_example"
graphab_habitat(proj_name = proj_name,
name = "forest",
type = "raster",
rast_codes = c(1,2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.