Description Usage Arguments Details Value Note Author(s) Examples
View source: R/setup_grass_environment.R
This function sets the 'GRASS' mapset to PERMANENT and sets its projection and extension.
1 | setup_grass_environment(dem, gisBase, epsg = NULL, sites = NULL, ...)
|
dem |
character; path to DEM. |
gisBase |
character; the directory path to GRASS binaries and libraries, containing bin and lib subdirectories among others (see details). |
epsg |
integer (deprecated); not used any more. Only included for compatibility with previous version. |
sites |
(deprecated); not used any more. Only included for compatibility with previous version. |
... |
Optional arguments to be passed to |
A GRASS session is initiated using initGRASS
. The path to
the GRASS program must be provided as gisBase
. For Linux, this might look like
"/usr/lib/grass78/" and for Windows "c:/Program Files/GRASS GIS 7.8".
Optional arguments are for example
* gisDbase
: the GRASS GISBASE directory for this session; defaults to tempdir()
* location
: name of the location for this session; defaults to tempfile()
* override
: TRUE for allowing to override an existing location.
Nothing. A GRASS session is initiated and the 'GRASS' mapset is set to PERMANENT. The geographical projection, geographical extension, number of columns and number of rows for the data and the resolution are defined by the dem. They are stored the DEFAULT_WIND file.
It is no longer required to initiate a GRASS session before using initGRASS
!
Mira Kattwinkel, mira.kattwinkel@gmx.net
1 2 3 4 5 6 7 8 9 10 11 12 13 | # path to GRASS
if(.Platform$OS.type == "windows"){
gisbase = "c:/Program Files/GRASS GIS 7.6"
} else {
gisbase = "/usr/lib/grass78/"
}
# path to the dem
dem_path <- system.file("extdata", "nc", "elev_ned_30m.tif", package = "openSTARS")
setup_grass_environment(dem = dem_path,
gisBase = gisbase,
location = "nc_example_location",
override = TRUE)
gmeta()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.