leaf_reaches: Return leaf reaches from a network or query intersecting lake

Description Usage Arguments Value Examples

View source: R/network.R

Description

A leaf reach is a stream flowline that has upstream connections but is not in the focal set.

Usage

1
leaf_reaches(lon = NA, lat = NA, network = NA, approve_all_dl = FALSE, ...)

Arguments

lon

numeric decimal degree longitude. optional. See Details section.

lat

numeric decimal degree latitude. optional. See Details section.

network

sf lines collection. optional. See Details section.

approve_all_dl

logical blanket approval to download all missing data. Defaults to TRUE if session is non-interactive.

...

parameters passed on to sf::st_read

Value

An sf data frame with LINESTRING geometries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
coords <- data.frame(lat = 20.79722, lon = -156.47833)
leaf_reaches(coords$lon, coords$lat)

coords  <- data.frame(lat = 41.42217, lon = -73.24189)
l_reach <- leaf_reaches(coords$lon, coords$lat)

network <- nhd_plus_query(lon = coords$lon, lat = coords$lat,
  dsn = "NHDFlowline", buffer_dist = 0.02)$sp$NHDFlowline
l_reach <- leaf_reaches(network = network)

plot(network$geometry)
plot(l_reach$geometry, col = "red", add = TRUE)

## End(Not run)

nhdR documentation built on July 17, 2021, 5:06 p.m.