View source: R/SOptim_ImportConvertData.R
importToGRASS | R Documentation |
An auxiliary function used to import raster files into GRASS GIS using r.import
command line interface. Inside R
the shell
function is used to run the temporary a GRASS batch run file which will invoke a single batch
file with r.import
command.
importToGRASS(
fileList,
GRASS.path = "grass70",
GRASS.GISDBASE,
GRASS.LOCATION_NAME,
GRASS.MAPSET = "PERMANENT",
addParams = "",
verbose = TRUE,
...
)
fileList |
A list of complete raster file paths to import to GRASS. |
GRASS.path |
Defines the initialization path to GRASS .bat file for windows (for example: 'C:/GRASS/grass70') or the .sh or .py file for Linux (usually this should be set to '/usr/bin/grass'). The default is "grass70" which assumes that GRASS is in the path environmental variables and version 7.0.x (which may not be appropriate in most cases and therefore this parameter should be set explicitly). |
GRASS.GISDBASE |
Name of GRASS GIS database. |
GRASS.LOCATION_NAME |
Name of GRASS location name (default: "demolocation"). |
GRASS.MAPSET |
Name of GRASS mapset (default: "PERMANENT"). |
addParams |
Additional parameters or flags passed to GRASS GIS |
verbose |
Print messages? (default: TRUE) |
... |
Further arguments passed to |
By default the name of raster files imported to GRASS will have the same file basename as in fileList
without the extension (check basename
and file_path_sans_ext
).
The working directory will be used to place some batch temporary files responsible to run GRASS GIS raster
importer through r.import()
(for more info check: https://grass.osgeo.org/grass72/manuals/r.import.html).
By default the function will overwrite (flag: --overwrite
) any existing file with the same output name and use
1024MB of memory (parameter: memory=1024
).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.