Commit 8f92df03 authored by David Watkins's avatar David Watkins
Browse files

setAccess for levels

parent e3348ab7
...@@ -34,11 +34,7 @@ ...@@ -34,11 +34,7 @@
#TODO: separate id and agency name, give also as separate dimensions #TODO: separate id and agency name, give also as separate dimensions
importNGWMN_wml2 <- function(input, asDateTime=FALSE, tz=""){ importNGWMN_wml2 <- function(input, asDateTime=FALSE, tz=""){
if(tz != ""){ if(tz != ""){
tz <- match.arg(tz, c("America/New_York","America/Chicago", tz <- match.arg(tz, OlsonNames())
"America/Denver","America/Los_Angeles",
"America/Anchorage","America/Honolulu",
"America/Jamaica","America/Managua",
"America/Phoenix","America/Metlakatla"))
}else{tz = "UTC"} }else{tz = "UTC"}
raw <- FALSE raw <- FALSE
......
...@@ -156,8 +156,10 @@ readNGWMNsites <- function(featureID){ ...@@ -156,8 +156,10 @@ readNGWMNsites <- function(featureID){
retrieveObservation <- function(featureID, asDateTime, attrs){ retrieveObservation <- function(featureID, asDateTime, attrs){
#will need to contruct this more piece by piece if other versions, properties are added #will need to contruct this more piece by piece if other versions, properties are added
baseURL <- "https://cida-test.er.usgs.gov/ngwmn_cache/sos?request=GetObservation&service=SOS&version=2.0.0&observedProperty=urn:ogc:def:property:OGC:GroundWaterLevel&responseFormat=text/xml&featureOfInterest=VW_GWDP_GEOSERVER." #baseURL <- "https://cida-test.er.usgs.gov/ngwmn_cache/sos?request=GetObservation&service=SOS&version=2.0.0&observedProperty=urn:ogc:def:property:OGC:GroundWaterLevel&responseFormat=text/xml&featureOfInterest=VW_GWDP_GEOSERVER."
url <- paste0(baseURL, featureID) url <- drURL(base.name = "NGWMN", access = pkg.env$access, request = "GetObservation",
service = "SOS", version = "2.0.0", observedProperty = "urn:ogc:def:property:OGC:GroundWaterLevel",
responseFormat = "text/xml", featureOfInterest = paste("VW_GWDP_GEOSERVER", featureID, sep = "."))
returnData <- importNGWMN_wml2(url, asDateTime) returnData <- importNGWMN_wml2(url, asDateTime)
if(nrow(returnData) == 0){ if(nrow(returnData) == 0){
......
...@@ -55,6 +55,8 @@ access = match.arg(access, c('public','internal','cooperator','USGS')) ...@@ -55,6 +55,8 @@ access = match.arg(access, c('public','internal','cooperator','USGS'))
pkg.env$wqpData = "https://www.waterqualitydata.us/Result/search" pkg.env$wqpData = "https://www.waterqualitydata.us/Result/search"
pkg.env$wqpStation = "https://www.waterqualitydata.us/Station/search" pkg.env$wqpStation = "https://www.waterqualitydata.us/Station/search"
pkg.env$NGWMN = "https://cida-test.er.usgs.gov/ngwmn_cache/sos"
options(Access.dataRetrieval = access) options(Access.dataRetrieval = access)
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment