reservoir_outlet: Determine outlet coordinates of reservoirs

View source: R/reservoir_outlet.R

reservoir_outletR Documentation

Determine outlet coordinates of reservoirs

Description

Takes a flow accumulation raster (or DEM for computation) and reservoir vector file from a GRASS location and estimates the outlet coordinates of each reservoir polygon. Can be run before reservoir_strategic to produce the required input. May also be used to provide outlet points for subbasin delineation.

Usage

reservoir_outlet(flowacc = NULL, dem = NULL, res_vct = NULL,
  outlets_vect = NULL, keep_temp = FALSE, overwrite = FALSE,
  silent = F)

Arguments

flowacc

Flow accumulation raster in GRASS location used for determination of reservoir outlets (= highest accumulation value). Set to NULL if it should be calculated based on a DEM. Default: NULL.

dem

Digital elevation model in GRASS location used for calculation of flow accumulation if no flow accumulation raster is given. Default: NULL.

res_vct

Reservoir vector file (polygon) in GRASS location. For each polygon coordinates of the outlet (cell with highest flow accumulation) are determined. Needs at least the column res_id (integer) as reservoir identifier. If there are no columns elevation (double) and area (double) [hectars], they will be added.

outlets_vect

Output: Name of vector file of outlet locations to be exported to GRASS location. Same fields as res_vct, fields res_id, elevation and area may have been added.

keep_temp

logical. Set to TRUE if temporary files shall be kept in the GRASS location, e.g. for debugging or further analyses. Default: FALSE.

overwrite

logical. Shall output of previous calls of this function be deleted? If FALSE the function returns an error if output already exists. Default: FALSE.

silent

logical. Shall the function be silent (also suppressing warnings of internally used GRASS functions)? Default: FALSE.

Value

Function returns nothing, but produces outlets_vect. WARNING: Up to version 2.5.0 this function returned a SpatialPoints object with the outlet coordinates.

Note

Prepare GRASS location and necessary files in advance and start GRASS session in R using initGRASS. Location should not contain any maps ending on *_t as these will be removed by calling the function to remove temporary maps.

Internal operations require a non-dbf datatabes driver (SQLite, PostgreSQL, MySQL, ODBC, ...). Automatic switiching to sqlite will be attempted.

res_vct must not contain a column cat_new as this will be the new identifier column for outlets_vect.

Check the results by investigating vector file with outlet points written to GRASS location. Due to small projection inaccuracies between the DEM / flow accumulation raster and the reservoir vector file, calculated outlet locations might more or less deviate from true locations!

Can be run before reservoir_strategic.

Author(s)

Tobias Pilz tpilz@uni-potsdam.de


tpilz/LUMP documentation built on Aug. 5, 2023, 1:31 a.m.