Learn R Programming

nhdplusTools (version 0.3.16)

get_node: Get flowline node

Description

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

Usage

get_node(x, position = "end")

Arguments

x

sf data.frame with one or more flowlines

position

character either "start" or "end"

Examples

Run this code
# NOT RUN {
fline <- sf::read_sf(system.file("extdata/sample_natseamless.gpkg",
                             package = "nhdplusTools"),
                 "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)

# }

Run the code above in your browser using DataLab