Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 updates and some shorter processing jobs #238

Merged
merged 3 commits into from
Feb 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Imports:
XML,
methods,
httr,
curl,
sp,
utils
Suggests:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ importFrom(XML,xmlRoot)
importFrom(XML,xmlTreeParse)
importFrom(XML,xmlValue)
importFrom(XML,xpathApply)
importFrom(curl,curl_version)
importFrom(httr,GET)
importFrom(httr,POST)
importFrom(httr,add_headers)
Expand Down
4 changes: 2 additions & 2 deletions R/algorithmVersion-webprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
algorithmVersion <- function(knife){
getCaps <- gGET(url(knife), query = list(
'service' = 'WPS', 'version' = version(knife),'request' = 'DescribeProcess', 'identifier'=algorithm(knife)[[1]]))
doc <- htmlParse(getCaps,isURL=FALSE, useInternalNodes = TRUE)
doc <- gcontent(getCaps)

version <- xmlAttrs(getNodeSet(doc,'//processdescription')[[1]])[['wps:processversion']]
version <- xmlAttrs(getNodeSet(doc,'//ProcessDescription')[[1]])[['processVersion']]
return(version)
}
2 changes: 2 additions & 0 deletions R/geoknifeUtils.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @importFrom curl curl_version
#' @importFrom utils packageVersion
geoknifeUserAgent <- function() {
versions <- c(
libcurl = curl::curl_version()$version,
Expand Down
4 changes: 1 addition & 3 deletions R/start-geojob.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ setMethod(f = "start",signature(.Object = "geojob"),definition = function(.Objec
}
requestXML <- xml(.Object)
data <- genericExecute(url = url(.Object), requestXML)

xmltext <- xmlTreeParse(data, asText = TRUE,useInternalNodes=TRUE)
xmltext <- gcontent(data)
response <- xmlRoot(xmltext)
responseNS <- xmlNamespaceDefinitions(response, simplify = TRUE)
processID <- xmlGetAttr(response,"statusLocation")

id(.Object) <- processID
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fabric <- webdata(list(
url = 'http://cida.usgs.gov/thredds/dodsC/prism',
variables = 'ppt'))
# modify the times field:
times(fabric) <- as.POSIXct(c('1990-01-01','2005-01-01'))
times(fabric) <- as.POSIXct(c('2003-01-01','2005-01-01'))
```
#####create the processing job that will carry out the subsetting/summarization task
```{r}
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`geoknife` package version 1.1.3
`geoknife` package version 1.1.4
================================

[![Build status](https://ci.appveyor.com/api/projects/status/0iacmg82mp50426o/branch/master)](https://ci.appveyor.com/project/jread-usgs/geoknife/branch/master) [![Build Status](https://travis-ci.org/USGS-R/geoknife.svg)](https://travis-ci.org/USGS-R/geoknife) [![Coverage Status](https://coveralls.io/repos/USGS-R/geoknife/badge.svg)](https://coveralls.io/r/USGS-R/geoknife) [![Download Count](http://cranlogs.r-pkg.org/badges/geoknife)](https://cran.r-project.org/package=geoknife)
Expand Down Expand Up @@ -71,7 +71,7 @@ fabric <- webdata(list(
url = 'http://cida.usgs.gov/thredds/dodsC/prism',
variables = 'ppt'))
# modify the times field:
times(fabric) <- as.POSIXct(c('1990-01-01','2005-01-01'))
times(fabric) <- as.POSIXct(c('2003-01-01','2005-01-01'))
```

##### create the processing job that will carry out the subsetting/summarization task
Expand All @@ -87,7 +87,7 @@ check(job)
## [1] "Process successful"
##
## $URL
## [1] "http://cida.usgs.gov:80/gdp/process/RetrieveResultServlet?id=6eb2b033-ca7b-4366-8bf7-21d66774d585OUTPUT"
## [1] "http://cida.usgs.gov:80/gdp/process/RetrieveResultServlet?id=0ac86798-7a2f-47c8-b153-3673e77e3e80OUTPUT"
##
## $statusType
## [1] "ProcessSucceeded"
Expand All @@ -107,8 +107,9 @@ data <- result(job)
plot(data[,1:2], ylab = variables(fabric))
```

![](README_files/figure-markdown_github/unnamed-chunk-7-1.png)
\#\#\#\#\#use an email to listen for process completion
![](README_files/figure-markdown_github/unnamed-chunk-7-1.png)<!-- -->

##### use an email to listen for process completion

``` r
job <- geoknife(webgeom('state::New Hampshire'), fabric = 'prism', email = 'fake.email@gmail.com')
Expand Down
Binary file modified README_files/figure-markdown_github/unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vignettes/geoknife.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fabric
```
which can be a starting point for the PRISM dataset, as the fields can be modified:
```{r}
times(fabric) <- c('1990-01-01','2010-01-01')
times(fabric) <- c('2002-01-01','2010-01-01')
variables(fabric) <- c('ppt','tmx', 'tmn')
fabric
```
Expand Down