Skip to content

Commit

Permalink
Merge pull request #357 from wdwatkins/master
Browse files Browse the repository at this point in the history
removed messages, version update for GRAN
  • Loading branch information
ldecicco-USGS authored Apr 5, 2017
2 parents ab672a4 + fdafd19 commit 14dcbc4
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 24 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: dataRetrieval
Type: Package
Title: Retrieval Functions for USGS and EPA Hydrologic and Water Quality Data
Version: 2.6.8
Date: 2017-01-20
Version: 2.6.8.1
Date: 2017-04-05
Authors@R: c( person("Robert", "Hirsch", role = c("aut"),
email = "[email protected]"),
person("Laura", "DeCicco", role = c("aut","cre"),
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dataRetrieval 2.6.8.1
* Added National Groundwater Monitoring Network services, and new Water Quality Portal features.

dataRetrieval 2.6.3
==========
* All USGS web services are being flipped from http to https. This version of dataRetrieval will attempt to access https, if that fails, will attempt http.
Expand Down
16 changes: 1 addition & 15 deletions R/getWebServiceData.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,7 @@
#' }
getWebServiceData <- function(obs_url, ...){

returnedList <- tryCatch({
retryGetOrPost(obs_url, ...)
}, error = function(e){
NULL
})

if(is.null(returnedList)){
message("Switching from https to http")
obs_url <- gsub("https", "http", obs_url)
returnedList <- tryCatch({
retryGetOrPost(obs_url, ...)
}, error = function(e){
NULL
})
}
returnedList <- retryGetOrPost(obs_url, ...)

if(status_code(returnedList) != 200){
message("For: ", obs_url,"\n")
Expand Down
4 changes: 2 additions & 2 deletions R/importNGWMN_wml2.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ importNGWMN <- function(input, asDateTime=FALSE, tz="UTC"){
}
nonDateCols <- grep("date",names(mergedDF), value=TRUE, invert = TRUE)

if(length(mergedDF) > 0){
if(nrow(mergedDF) > 0){
mergedDF[nonDateCols][mergedDF[nonDateCols] == "" | mergedDF[nonDateCols]== -999999.0] <- NA
}
attr(mergedDF, "gml:identifier") <- xml_text(xml_find_all(returnedDoc, ".//gml:identifier"))
Expand Down Expand Up @@ -153,7 +153,7 @@ importWaterML2 <- function(input, asDateTime=FALSE, tz="UTC") {
if(length(TVP) == 0) { #empty nodes on some sites
return(data.frame(site = character(0), source = character(0), date = character(0),
time = character(0), dateTime = character(0), value = numeric(0),
uom = character(0), comment = charater(0), stringsAsFactors = FALSE))
uom = character(0), comment = character(0), stringsAsFactors = FALSE))
}
rawTime <- xml_text(xml_find_all(TVP,".//wml2:time"))

Expand Down
4 changes: 2 additions & 2 deletions R/readNGWMNdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
#' noDataSite <- readNGWMNdata(siteNumbers = noDataSite, service = "observation")
#'
#' #bounding box
#' bboxSites <- readNGWMNdata(service = "featureOfInterest", bbox = c(30, -99, 31, 102))
#' #retrieve 100 sites. Set asDateTime to false since one site has an invalid date
#' bboxSites <- readNGWMNdata(service = "featureOfInterest", bbox = c(30, -102, 31, 99))
#' #retrieve sites. Set asDateTime to false since one site has an invalid date
#' bboxData <- readNGWMNdata(service = "observation", siteNumbers = bboxSites$site[1:3],
#' asDateTime = FALSE)
#' }
Expand Down
4 changes: 2 additions & 2 deletions man/readNGWMNdata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/tests_imports.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ test_that("External importRDB1 tests", {


site <- "05427850"

url <- constructNWISURL(site,"00060","2015-01-01", "","dv",
format="tsv",
statCd = "laksjd")
# And....now there's data there:
expect_error(importRDB1(url))

})

context("importRDB")
Expand Down

0 comments on commit 14dcbc4

Please sign in to comment.