Skip to contents

This function takes an XY location as a starting point and generates a flowpath for use in the N-Sink nitrogen removal analysis. The flowpath is a combination of a flow direction derived flowpath on land plus NHDPlus derived stream-reach flowpath.

Usage

nsink_generate_flowpath(starting_location, input_data)

Arguments

starting_location

An sf point location as a starting point for the flowpath. Projection must match projection in input_data.

input_data

A list of input data with (at least) "fdr", "streams", "tot", and "raster_template". These may be generated with nsink_prep_data.

Value

An sf LINESTRING object of the flowpath that starts at the starting_location and ends at the ouflow of the HUC.

Examples

if (FALSE) {
library(nsink)
niantic_huc <- nsink_get_huc_id("Niantic River")$huc_12
niantic_data <- nsink_get_data(niantic_huc, data_dir = "nsink_data")
aea <- 5072
niantic_nsink_data <- nsink_prep_data(niantic_huc, projection = aea,
                                      data_dir = "nsink_niantic_data")
pt <- c(1948121, 2295822)
start_loc <- st_sf(st_sfc(st_point(c(pt)), crs = aea))
fp <- nsink_generate_flowpath(start_loc, niantic_nsink_data)
}