vector_to_mapset: Import rasters into GRASS mapset

View source: R/vector_to_mapset.R

vector_to_mapsetR Documentation

Import rasters into GRASS mapset

Description

GRASS can only deal with raster and vector data in a GRASS mapset. This function takes external vectors and imports them into the current GRASS mapset.

Usage

vector_to_mapset(vectors, overwrite = FALSE, ...)

Arguments

vectors

A character vector of filenames of shapefiles to import.

overwrite

A logical indicating whether the overwrite flag should be used. Defaults to FALSE.

...

Additional arguments to v.import.

Value

A vector of vector layer names in the GRASS mapset.

Examples

# Will only run if GRASS is running
if(check_running()){

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

# Set environment parameters
set_envir(dem)

# Import vector data to mapset
vector_to_mapset(vectors = stream_shp)

}

rdwplus documentation built on April 4, 2025, 1:49 a.m.