set_envir {rdwplus}R Documentation

Set projection and computation region from a raster file.

Description

This function simplifies the process of setting up a GRASS environment with parameters such as cell snapping, size and mapset extent.

Usage

set_envir(file, ...)

Arguments

file

The file path to a raster that should be used to set environment parameters such as the projection, cell size, extent, etc. The file argument will automatically be imported into the mapset as basename(file).

...

Optional arguments for raster_to_mapset(). The main argument of interest for most users will be overwrite, which should be set to true if an object of name basename(file) already exists in the mapset.

Value

Nothing. Displays current environment settings.

Examples

# Will only run if GRASS is running
# You should load rdwplus and initialise GRASS with initGRASS
if(check_running()){

# Load data set
dem <- system.file("extdata", "dem.tif", package = "rdwplus")

# Set environment 
set_envir(dem)

}

[Package rdwplus version 1.0.0 Index]