Description Usage Arguments Value Examples
This function gets the time series data values from the WaterML web service
1 2 3 4 5 6 7 8 9 10 11 |
server |
The URL of the web service, for example: http://worldwater.byu.edu/interactive/rushvalley/services/index.php/cuahsi_1_1.asmx?WSDL. This can be also a custom REST URL or the file name of the WaterML file. |
siteCode |
The site code. To get a list of available site codes, see GetSites() function and use the FullSiteCode field. |
variableCode |
The variable code. To get a list of possible variable codes, see GetVariables() function and use the FullVariableCode field |
startDate |
(optional) The start date in "yyyy-mm-dd" format |
endDate |
(optional) The end date in "yyyy-mm-dd" format |
methodID |
(optional) The ID of the observation method. To get a list of possible method IDs, see methodID column in the output of GetSiteInfo(). If methodID is not specified, then the observations in the output data.frame won't be filtered by method. |
sourceID |
(optional) The ID of the source. To get a list of possible source IDs, see sourceID column in the output of GetSiteInfo(). If sourceID is not specified, then the observations in the output data.frame won't be filtered by source. |
qcID |
(optional) The ID of the quality control level. Typically 0 is used for raw data and 1 is used for quality controlled data. To get a list of possible quality control level IDs, see QualityControlLevelID column in the output of GetSiteInfo(). If qcID is not specified, then the observations in the output data.frame won't be filtered by quality control level. |
daily |
(optional) If you set daily="max", daily="min" or daily="mean", then the data values are aggreagted to daily time step. |
a data.frame of data values with the following columns:
time: The local date/time of the observation. The data type is POSIXct. POSIXct is a data type in R for storing time.
DataValue: The observed data value
UTCOffset: The difference between local time and UTC time in hours
CensorCode: The code for censored observations. Possible values are nc (not censored), gt (greater than), lt (less than), nd (non-detect), pnq (present but not quantified)
DateTimeUTC: The UTC time of the observation. The data type is POSIXct. POSIXct is a special data type in R for storing time.
MethodCode: The code of the method or instrument used for the observation
SourceCode: The code of the data source
QualityControlLevelCode: The code of the quality control level. Possible values are -9999 (Unknown), 0 (Raw data), 1 (Quality controlled data), 2 (Derived products), 3 (Interpreted products), 4 (Knowledge products)
The output data.frame also has attributes with information about the status: download.time, parse.time, download.status, parse.status These attributes can be used for troubleshooting WaterOneFlow/WaterML server errors. If parse status is "NO_VALUES_FOUND", then this time series doesn't have any available data for the selected time period.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #example 1: Get Values from a known site and variable from Ipswich River server.
server <- "http://hydroportal.cuahsi.org/ipswich/cuahsi_1_1.asmx?WSDL"
v1 <- GetValues(server, site="IRWA:FB-BV", variable="IRWA:DO",
startDate="1999-01-01", endDate="1999-12-31")
#example 2: Get values from an external REST URL (in this case the Provo USGS NWIS site id 10163000)
url <- "http://waterservices.usgs.gov/nwis/dv/?format=waterml,1.1&sites=10163000¶meterCd=00060"
v2 <- GetValues(url)
#example 3: Get values from WaterML 2.0 file and show year, month, day
url2 <- "http://www.waterml2.org/KiWIS-WML2-Example.wml"
waterml2_data <- GetValues(url2)
waterml2_data$year <- strftime(waterml2_data$time, "%Y")
waterml2_data$month <- strftime(waterml2_data$time, "%M")
waterml2_data$day <- strftime(waterml2_data$time, "%d")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.