library(rmarkdown)
options(continue=" ")
options(width=60)
library(knitr)

Sample workflow:

There is a convience function to make a map with state boundaries, major lakes, and flow lines. This function can take quite awhile to complete, especially for larger map areas. It is not recommended for areas larger than one state.

library(hydroMap)
library(dataRetrieval)

Range=c(-86.32679,-81.16322,39.61600,43.06262)
sites=c("04189000","04197100","04198000","04185000","04199500","04176500","04193500")
siteInfo <- readNWISsite(sites)

# png("test.png",width=11,height=8,units="in",res=600,pointsize=4)
plotWSB(sites, mapRange=Range, streamorder = 5)
points(siteInfo$dec_long_va, siteInfo$dec_lat_va, pch=20, col="red", cex=3)
box()
# dev.off()

Interactive workflow:

library(leaflet)
basins <- getBasin(sites)
Range=c(-86.32679,-81.16322,39.61600,43.06262)
flowLines <- getFlowLines(Range, streamorder = 5)

leaflet() %>% 
  addProviderTiles("CartoDB.Positron") %>% 
  setView(-84, 41.35, zoom = 8) %>%
  addPolygons(data=basins, weight=2, color = "grey") %>%
  addPolylines(data=flowLines, weight=1) %>%
  addCircleMarkers(siteInfo$dec_long_va,siteInfo$dec_lat_va,
                   color = "red",
                   radius=4,
                   stroke=FALSE,
                   fillOpacity = 0.8, opacity = 0.8,
                   popup=siteInfo$station_nm)

Disclaimer

Software created by USGS employees along with contractors and grantees (unless specific stipulations are made in a contract or grant award) are to be released as Public Domain and free of copyright or license. Contributions of software components such as specific algorithms to existing software licensed through a third party are encouraged, but those contributions should be annotated as freely available in the Public Domain wherever possible. If USGS software uses existing licensed components, those licenses must be adhered to and redistributed.

Although this software has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to accuracy and functionality, nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.



ldecicco-USGS/hydroMaps documentation built on May 31, 2020, 12:44 p.m.