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

Fixing WQP bounding box problem.

parent 626a736d
No related branches found
No related tags found
1 merge request!127WQP update.
......@@ -100,7 +100,7 @@ readWQPdata <- function(...){
matchReturn <- list(...)
values <- sapply(matchReturn, function(x) URLencode(as.character(paste(eval(x),collapse=";",sep=""))))
values <- sapply(matchReturn, function(x) as.character(paste(eval(x),collapse=";",sep="")))
if("bBox" %in% names(values)){
values['bBox'] <- gsub(pattern = ";", replacement = ",", x = values['bBox'])
......@@ -141,16 +141,13 @@ readWQPdata <- function(...){
} else {
tz <- ""
}
values <- gsub(",","%2C",values)
values <- gsub(";","%3B",values)
values <- gsub("%20","+",values)
values <- gsub(":","%3A",values)
urlCall <- paste(paste(names(values),values,sep="="),collapse="&")
baseURL <- "http://www.waterqualitydata.us/Result/search?"
# baseURL <- "http://wqp-test.er.usgs.gov/Result/search?&sorted=no"
urlCall <- paste0(baseURL,
urlCall,
"&mimeType=tsv")
......
......@@ -59,7 +59,7 @@ whatWQPsites <- function(...){
matchReturn <- list(...)
values <- sapply(matchReturn, function(x) URLencode(as.character(paste(eval(x),collapse=";",sep=""))))
values <- sapply(matchReturn, function(x) as.character(paste(eval(x),collapse=";",sep="")))
if("tz" %in% names(values)){
values <- values[!(names(values) %in% "tz")]
......@@ -80,10 +80,10 @@ whatWQPsites <- function(...){
names(values)[names(values) == "stateCd"] <- "statecode"
}
values <- gsub(",","%2C",values)
values <- gsub(";","%3B",values)
# values <- gsub(",","%2C",values)
# values <- gsub(";","%3B",values)
values <- gsub("%20","+",values)
values <- gsub(":","%3A",values)
# values <- gsub(":","%3A",values)
if("bBox" %in% names(values)){
values['bBox'] <- gsub(pattern = ";", replacement = ",", x = values['bBox'])
......@@ -95,6 +95,7 @@ whatWQPsites <- function(...){
baseURL <- "http://www.waterqualitydata.us/Station/search?"
# baseURL <- "http://wqp-test.er.usgs.gov/Station/search?sorted=no&"
urlCall <- paste(baseURL,
urlCall,
"&mimeType=tsv",sep = "")
......
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