From 7d568f67d29f62207484fb562dd00039ebb1a791 Mon Sep 17 00:00:00 2001
From: ldecicco <ldecicco@usgs.gov>
Date: Tue, 11 Feb 2014 15:03:15 -0600
Subject: [PATCH] Fixed small bug in getting uv data.

---
 R/constructNWISURL.r | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/R/constructNWISURL.r b/R/constructNWISURL.r
index b57c557a..2aaf71a4 100644
--- a/R/constructNWISURL.r
+++ b/R/constructNWISURL.r
@@ -119,7 +119,12 @@ constructNWISURL <- function(siteNumber,parameterCd,startDate,endDate,service,st
             parameterCd <- formatCheckParameterCd(parameterCd, interactive=interactive)
           }
           
-          if ("uv"==service) service <- "iv"
+          if ("uv"==service) {
+            service <- "iv"
+            baseURL <- paste("http://nwis.waterservices.usgs.gov/nwis/",service,sep="")  
+          } else {
+            baseURL <- paste("http://waterservices.usgs.gov/nwis/",service,sep="")  
+          }
           
           if ("xml"==format){ 
             format <- "waterml,1.1"
@@ -129,7 +134,7 @@ constructNWISURL <- function(siteNumber,parameterCd,startDate,endDate,service,st
             warning("non-supported format requested, please choose xml or tsv")
           }
              
-          baseURL <- paste("http://waterservices.usgs.gov/nwis/",service,sep="")  
+          
           
           url <- paste(baseURL,"/?site=",siteNumber, "&ParameterCd=",parameterCd, "&format=", format, sep = "")
           
-- 
GitLab