Skip to content

Commit

Permalink
Merge pull request #219 from jread-usgs/master
Browse files Browse the repository at this point in the history
several bug fixes and release of v1.1.1 for GRAN
  • Loading branch information
Jordan S Read committed Nov 13, 2015
2 parents 05d9fef + 3aab247 commit a0c3187
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: geoknife
Type: Package
Title: Web-Processing of Large Gridded Datasets
Version: 1.1.0
Date: 2015-10-02
Version: 1.1.1
Date: 2015-11-13
Authors@R: c( person("Jordan", "Read", role = c("aut","cre"),
email = "[email protected]"),
person("Jordan", "Walker", role = c("aut"),
Expand Down
2 changes: 1 addition & 1 deletion R/geoknife-generic.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ geoknife <- function(stencil, fabric, knife = webprocess(...), ...){
geojob <- geojob()
xml(geojob) <- XML(stencil, fabric, knife)
url(geojob) <- url(knife)
geojob@algorithm.version = algorithmVersion(knife)
geojob@algorithm.version <- algorithmVersion(knife)
geojob <- start(geojob)
if (!is.na(knife@email)) {
email(geojob, knife)
Expand Down
7 changes: 6 additions & 1 deletion R/inputs-webprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,15 @@ setMethod(f = "inputs<-",signature = c("webprocess",'list'),
})

.setInput <- function(.Object, name, arg){

if (is.logical(arg)){
arg <- ifelse(isTRUE(arg),'true','false')
}

if (!is.character(arg))
stop('Process inputs values must be characters.')
if (!name %in% names(.Object@processInputs))
stop(name,' not found in ', paste(names(inputs(.Object)), collapse = ', '))
stop(name,' not found in ', paste(c('url', 'algorithm', 'version', 'email', 'wait', names(inputs(.Object))), collapse = ', '), call. = FALSE)
.Object@processInputs[[name]] <- arg
return(.Object)
}
12 changes: 10 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ output:
[![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)](http://cran.r-project.org/web/packages/geoknife/index.html)
Tools for geo-web processing of gridded data via the [Geo Data Portal](http://cida.usgs.gov/gdp/ "Geo Data Portal"). `geoknife` slices up gridded data according to overlap with irregular features, such as watersheds, lakes, points, etc. The result is subsetted data in plain text, NetCDF, geotiff or other formats.
<p align="center">
<img src="http://usgs-r.github.io/images/geoknife.png" alt="GDP" align="center">
Expand All @@ -20,13 +21,20 @@ Tools for geo-web processing of gridded data via the [Geo Data Portal](http://ci


###Installing `geoknife`
To install the stable version of `geoknife` package with dependencies:

To install the `geoknife` from CRAN:
``` r
install.packages("geoknife")
```

To install the stable version of `geoknife` package with dependencies:
```{r, eval=FALSE}
install.packages("geoknife",
repos = c("http://owi.usgs.gov/R","http://cran.rstudio.com/"),
dependencies = TRUE)
```
Or to install the current development version of the package:

Or to install the current development version of the package:
```{r, eval=FALSE}
install.packages("devtools")
devtools::install_github('USGS-R/geoknife')
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
`geoknife` package version 1.0.0
`geoknife` package version 1.1.1
================================

[![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)](http://cran.r-project.org/web/packages/geoknife/index.html) Tools for geo-web processing of gridded data via the [Geo Data Portal](http://cida.usgs.gov/gdp/ "Geo Data Portal"). `geoknife` slices up gridded data according to overlap with irregular features, such as watersheds, lakes, points, etc. The result is subsetted data in plain text, NetCDF, geotiff or other formats.
[![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)](http://cran.r-project.org/web/packages/geoknife/index.html)
Tools for geo-web processing of gridded data via the [Geo Data Portal](http://cida.usgs.gov/gdp/ "Geo Data Portal"). `geoknife` slices up gridded data according to overlap with irregular features, such as watersheds, lakes, points, etc. The result is subsetted data in plain text, NetCDF, geotiff or other formats.
<p align="center">
<img src="http://usgs-r.github.io/images/geoknife.png" alt="GDP" align="center">
</p>
### Installing `geoknife`

To install the `geoknife` from CRAN:

``` r
install.packages("geoknife")
```
Expand Down Expand Up @@ -86,7 +87,7 @@ check(job)
## [1] "Process successful"
##
## $URL
## [1] "http://cida.usgs.gov:80/gdp/process/RetrieveResultServlet?id=d5798a2e-0ea0-4ac2-89f2-c9cca72b41ccOUTPUT"
## [1] "http://cida.usgs.gov:80/gdp/process/RetrieveResultServlet?id=49dd54bc-ccb3-4fd7-ab75-293b243812aaOUTPUT"
##
## $statusType
## [1] "ProcessSucceeded"
Expand Down
15 changes: 14 additions & 1 deletion tests/testthat/test-webprocess_input.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,17 @@ test_that("can use multiple dataset variables",{
cancel()
knife <- webprocess(algorithm = list('Categorical Coverage Fraction'="gov.usgs.cida.gdp.wps.algorithm.FeatureCategoricalGridCoverageAlgorithm"))
expect_is(geoknife(stencil = 'state::Wisconsin', fabric, knife),'geojob')
})
})

test_that("you can set booleans and they will be lowercase strings for post",{
expect_equal(webprocess(REQUIRE_FULL_COVERAGE = F), webprocess(REQUIRE_FULL_COVERAGE = 'false'))
})

test_that("you can set booleans as pass through",{
cancel()
job = geoknife(simplegeom(data.frame(point1 = c(-48.6, 45.2), point2=c(-88.6, 45.2))), 'prism', REQUIRE_FULL_COVERAGE = FALSE, wait=TRUE)
expect_true(all(is.na(result(job)$point1)))
job = geoknife(simplegeom(data.frame(point1 = c(-48.6, 45.2), point2=c(-88.6, 45.2))), 'prism', REQUIRE_FULL_COVERAGE = TRUE, wait=TRUE)

expect_true(error(job))
})

0 comments on commit a0c3187

Please sign in to comment.