Skip to content
Snippets Groups Projects
Commit 93bb07a4 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Fixed a re-direct issue with readNWISdata.

parent e72e7803
No related branches found
No related tags found
1 merge request!83Unit tests and bug fix.
...@@ -63,22 +63,18 @@ readNWISdata <- function(service="dv", ...){ ...@@ -63,22 +63,18 @@ readNWISdata <- function(service="dv", ...){
urlCall <- paste(paste(names(values),values,sep="="),collapse="&") urlCall <- paste(paste(names(values),values,sep="="),collapse="&")
if(service %in% c("dv","iv","gwlevels")){ format <- "waterml,1.1"
format <- "waterml"
if(service == "iv"){
baseURL <- "http://nwis.waterservices.usgs.gov/nwis/"
} else { } else {
format <- "rdb1,1" baseURL <- "http://waterservices.usgs.gov/nwis/"
} }
baseURL <- paste0("http://waterservices.usgs.gov/nwis/",service,"/?format=",format,"&") baseURL <- paste0(baseURL,service,"/?format=",format,"&")
urlCall <- paste0(baseURL,urlCall) urlCall <- paste0(baseURL,urlCall)
if(service=="qwdata"){ retval <- importWaterML1(urlCall, asDateTime = ("iv" == service))
urlCall <- paste0(urlCall,"&siteOutput=expanded")
retval <- importRDB1(urlCall)
} else {
retval <- importWaterML1(urlCall, asDateTime = ("iv" == service))
}
return(retval) return(retval)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment