point_to_raster {rdwplus}R Documentation

Convert outlet of a watershed from shapefile format into raster format

Description

Given a shapefile of outlet(s), this function will convert its contents into a raster.

Usage

point_to_raster(outlets, out, overwrite = FALSE, max_memory = 300)

Arguments

outlets

A shapefile of outlets in the current GRASS mapset.

out

The name of the output raster.

overwrite

A logical indicating whether the output should be allowed to overwrite existing files. Defaults to FALSE.

max_memory

Max memory used in memory swap mode (MB). Defaults to 300.

Value

Nothing. A file called out will be created in the current GRASS mapset.

Examples

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

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

# Set environment parameters and import data to GRASS
set_envir(dem)
vector_to_mapset(vectors = sites)

# Point to raster
point_to_raster(outlets = "site", out = "sites_rast.tif", overwrite = TRUE)

# Check conversion success
vibe_check()

}

[Package rdwplus version 1.0.0 Index]