coord_to_raster {rdwplus}R Documentation

Turn coordinates of outlets into rasters

Description

Given a set of x-y coordinates, this function will return a raster with a single cell at those coordinates.

Usage

coord_to_raster(outlets, which, out, overwrite = FALSE)

Arguments

outlets

The name of a set of sites in the current GRASS mapset.

which

A numeric identifier for the site to convert to raster.

out

The file name of the output outlet raster in the current GRASS mapset.

overwrite

Whether the output files should be allowed to overwrite existing files. Defaults to FALSE.

Details

This function is exposed to the user, and users are welcome to use if convenient for them, this function is intended for internal use in other functions.

Value

Nothing.

Examples

# Will only run if GRASS is running
if(check_running()){
# Load data set
dem <- system.file("extdata", "dem.tif", package = "rdwplus")
sts <- system.file("extdata", "sites.shp", packages = "rdwplus")

# Set environment parameters
set_envir(dem)

# Read in sites
vector_to_mapset(sts)

# Convert first site to raster
coord_to_raster("site", 1, "coords", overwrite = TRUE)
}

[Package rdwplus version 1.0.0 Index]