tellMeURL: USGS Daily Values Site Service URL

Description Usage Arguments Value References Examples

Description

Function that returns USGS Daily Values Site Service URL for troubleshooting or building a URL for other purposes.

Usage

1
2
tellMeURL(staid, code = "00060", stat = "00003", sdate = "1851-01-01",
  edate = as.Date(Sys.Date(), format = "%Y-%m-%d"))

Arguments

staid

is the USGS site identification number, which is usually eight digits long, but can be longer. Users may search for surface-water sites and obtain station identification numbers using the USGS Site Web Service, https://waterservices.usgs.gov/rest/Site-Service.html (U.S. Geological Survey, 2017d); using the National Water Information System: Mapper, https://maps.waterdata.usgs.gov/mapper/index.html (U.S. Geological Survey, 2017a); or using the National Water Information System: Web Interface to daily surface-water data, https://waterdata.usgs.gov/nwis/dv/?referred_module=sw (U.S. Geological Survey, 2017e). The site identification number needs to be entered as a character, that is in quotes, because many USGS streamgage numbers begin with zero and the leading zero is necessary.

code

is the USGS parameter code, a 5-digit number used in the USGS computerized data system, National Water Information System (NWIS), to uniquely identify a specific hydrologic property or constituent. A list of paramater codes is available at https://nwis.waterdata.usgs.gov/usa/nwis/pmcodes (U.S. Geological Survey, 2017b).

stat

is the USGS statistics code, a 5-digit number used in the USGS computerized data system, NWIS, to uniquely identify specific statistics, such as daily mean, daily maximum, and daily minimum. The default, 00003, is the mean daily value. A list of statistics codes is available at https://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table (U.S. Geological Survey, 2017c). Not all statistics are available at every gage.

sdate

is the start date of the time series, in the format yyyy-mm-dd.

edate

is the end date of the time series, in the format yyyy-mm-dd.

Value

URL for USGS data

References

U.S. Geological Survey, 2017a, National Water Information System: Mapper, accessed January 3, 2017, at https://maps.waterdata.usgs.gov/mapper/index.html.

U.S. Geological Survey, 2017b, Parameter code definition, National Water Information System: Web Interface, accessed January 3, 2017, at https://nwis.waterdata.usgs.gov/usa/nwis/pmcodes.

U.S. Geological Survey, 2017c, Stat codes (stat_cd), National Water Information System: Web Interface, accessed January 3, 2017, at https://nwis.waterdata.usgs.gov/nwis/help/?read_file=stat&format=table.

U.S. Geological Survey, 2017d, USGS site web service: REST Web Services, accessed January 3, 2017, at https://waterservices.usgs.gov/rest/Site-Service.html.

U.S. Geological Survey, 2017e, USGS surface-water daily data for the Nation: National Water Information System: Web Interface, accessed January 3, 2017, at http://waterdata.usgs.gov/nwis/dv/?referred_module=sw.

Examples

1
2
tellMeURL("05054000", code="00060", stat="00003", sdate="2000-01-01", 
 edate=as.Date(Sys.Date(), format="%Y-%m-%d"))

Example output

[1] "https://waterservices.usgs.gov/nwis/dv/?format=waterml,2.0&site=05054000&parameterCd=00060&statCd=00003&startDt=2000-01-01&endDt=2019-06-06"

waterData documentation built on May 2, 2019, 3:38 p.m.