Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Water
dataRetrieval
Commits
464327a3
Commit
464327a3
authored
Sep 10, 2021
by
Laura A DeCicco
Browse files
Catching a wierd condition where a URL doesn't return the content-type
parent
bdbeb444
Changes
4
Show whitespace changes
Inline
Side-by-side
R/getWebServiceData.R
View file @
464327a3
...
...
@@ -42,6 +42,11 @@ getWebServiceData <- function(obs_url, ...){
}
else
{
headerInfo
<-
httr
::
headers
(
returnedList
)
if
(
!
"content-type"
%in%
names
(
headerInfo
)){
message
(
"Unknown content, returning NULL"
)
return
(
invisible
(
NULL
))
}
if
(
headerInfo
$
`content-type`
%in%
c
(
"text/tab-separated-values;charset=UTF-8"
)){
returnedDoc
<-
httr
::
content
(
returnedList
,
type
=
"text"
,
encoding
=
"UTF-8"
)
}
else
if
(
headerInfo
$
`content-type`
%in%
...
...
R/importNGWMN_wml2.R
View file @
464327a3
...
...
@@ -25,9 +25,9 @@
#' "observedProperty=urn:ogc:def:property:OGC:GroundWaterLevel",
#' "responseFormat=text/xml",
#' "featureOfInterest=VW_GWDP_GEOSERVER.USGS.403836085374401",sep="&")
#'
if(!httr::http_error(obs_url)){
#'
#' data_returned <- importNGWMN(obs_url)
#'
}
#'
#' }
#'
importNGWMN
<-
function
(
input
,
asDateTime
=
FALSE
,
tz
=
"UTC"
){
...
...
man/importNGWMN.Rd
View file @
464327a3
...
...
@@ -32,9 +32,9 @@ obs_url <- paste("https://cida.usgs.gov/ngwmn_cache/sos?request=GetObservation",
"observedProperty=urn:ogc:def:property:OGC:GroundWaterLevel",
"responseFormat=text/xml",
"featureOfInterest=VW_GWDP_GEOSERVER.USGS.403836085374401",sep="&")
if(!httr::http_error(obs_url)){
data_returned <- importNGWMN(obs_url)
}
}
}
man/readNWISpCode.Rd
View file @
464327a3
...
...
@@ -27,6 +27,11 @@ parameterData data frame with the following information:
Imports data from NWIS about meaured parameter based on user-supplied parameter code or codes.
This function gets the data from here: \url{https://nwis.waterdata.usgs.gov/nwis/pmcodes}
}
\examples{
paramINFO <- readNWISpCode(c('01075','00060','00931'))
paramINFO <- readNWISpCode(c('01075','00060','00931', NA))
}
\seealso{
\code{\link{importRDB1}}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment