calc_stream_drn: Calculate polyline (e.g. stream) drain locations

Description Usage Arguments Value Author(s) See Also Examples

View source: R/calc_stream_drn.R

Description

Intended to provide a MODFLOW-USG Drain package that can be compared to the results of the PBJ package, given the same grid and stream.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
calc_stream_drn(
  stream,
  voronoi,
  str_id_col = "ID.1",
  vor_id_col = "ID",
  method = "node",
  correct_seg_order = T,
  seg_min_length = 1e-07,
  keep_stream_cols = NULL
)

Arguments

stream

sf polyline, "exploded" into segments (see line_explode)

voronoi

sf polygon of voronoi tesselation (unstructured model grid). Shapefile ID field will be used to determine node ID.

method

character, method to select drain nodes. Only overlap with [voronoi] nodes is currently supported (optional, default: 'node')

seg_min_length

numeric, minimum length of segment to include in calculation (default 1e-7). Generally just to weed out numerical errors.

Value

SF Object/DataFrame of nodes that can be used to gener

Author(s)

Leland Scantlebury

See Also

write.DRNpackage

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#-- Read in shapefiles
stream <- read_sf(system.file("extdata", "straight_river.shp", package = "pbjr"))
tri <- read_sf(system.file("extdata", "straight_triangles.shp", package = "pbjr"))
vor <- read_sf(system.file("extdata", "straight_voronoi.shp", package = "pbjr"))

#-- Explode polyline
stream <- line_explode(stream)

#-- Create DRNDF
drndf <- calc_stream_drn(stream = stream, voronoi = vor)

scantle/pbjr documentation built on Dec. 22, 2021, 10:19 p.m.