simplifybyselectsite2: Simplify the river topo (arc.set) with sites along the river

Description Usage Arguments Examples

View source: R/simplifybyselectsite2.R

Description

Simplify the river topo (arc.set) with sites along the river

Usage

1
simplifybyselectsite2(site_select_sf, arc_sf.set)

Arguments

arc_sf.set

a arc sf object from makearc() containing columns: from, seg0, vert0, x0, y0, to, seg1, vert1, x1, y1, geometry

site_sf

a site sf object with column: id, lon, lat, geometry, X, Y, and the snapped point information from the riverdist::xy2segvert() columns: seg, vert, snapdist

Examples

1
2
3
4
5
6
7
8
example run
arc_select_sf.set <- simplifybyselectsite2(site_select_sf = site_select_sf, arc_sf.set = arc_sf.set)
g <- ggplot() +
 geom_sf(data = arc_select_sf.set, color = "blue") + # site topologyt
 geom_sf(data = rivers %>% st_transform(crs = 2163), alpha = 0.3) + # river network
 geom_point(data = st_drop_geometry(site_select_sf), color = "black", aes(text=sprintf("USGS ID: %s", id), x = X, y = Y)) + # site location
 ggtitle("Site Topology Computed by the River Network Topology")
plotly::ggplotly(g)

WeiquanLuo/rivertopo documentation built on Jan. 28, 2020, 11:39 a.m.