get_node: Get flowline node

Description Usage Arguments Value Examples

View source: R/get_geometry.R

Description

Given one or more flowlines, returns a particular node from the flowline.

Usage

1
get_node(x, position = "end")

Arguments

x

sf data.frame with one or more flowlines

position

character either "start" or "end"

Value

sf data.frame containing requested nodes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
source(system.file("extdata/sample_data.R", package = "nhdplusTools"))

fline <- sf::read_sf(sample_data, "NHDFlowline_Network")

start <- get_node(fline, "start")
end <- get_node(fline, "end")

plot(sf::st_zm(fline$geom),
     lwd = fline$StreamOrde, col = "blue")
plot(sf::st_geometry(start), add = TRUE)

plot(sf::st_zm(fline$geom),
     lwd = fline$StreamOrde, col = "blue")
plot(sf::st_geometry(end), add = TRUE)

nhdplusTools documentation built on Aug. 18, 2021, 5:07 p.m.