Skip to content

Commit

Permalink
Merge pull request #207 from dblodgett-usgs/master
Browse files Browse the repository at this point in the history
changes that should allow the OUTPUT_TYPE to get set to application/z…
  • Loading branch information
Jordan S Read committed Oct 13, 2015
2 parents 05793c7 + 6efee9d commit 9f66e3f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: geoknife
Type: Package
Title: Web-Processing of Large Gridded Datasets
Version: 1.0.0
Version: 1.1.0
Date: 2015-10-02
Authors@R: c( person("Jordan", "Read", role = c("aut","cre"),
email = "[email protected]"),
Expand Down
7 changes: 4 additions & 3 deletions R/processInputsToXML.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ setGeneric(name="XML",def=function(stencil, fabric, knife){standardGeneric("XML"
setMethod(f = "XML",signature = c("ANY","webdata","webprocess"),
definition = function(stencil, fabric, knife){
#stencil can be webgeom OR simplegeom

knife <- .setProcessInputs(webprocess = knife, stencil = stencil, fabric = fabric)
top <- newXMLNode(name='wps:Execute',
attrs=c('service'="WPS",'version'= version(knife),
Expand Down Expand Up @@ -81,10 +80,12 @@ addResponse <- function(.Object, xmlNodes){

resDoc <- newXMLNode('wps:ResponseDocument',attrs=c('storeExecuteResponse'='true','status'='true'))
addChildren(resForm,resDoc)
#if text/tab-separated-values"

#if text/tab-separated-values" or output_type
if (!is.null(.Object@processInputs$DELIMITER) && .Object@processInputs$DELIMITER=="TAB"){
resOut <- newXMLNode('wps:Output',attrs=c('asReference'='true','mimeType'='text/tab-separated-values'))
} else if (!is.null(.Object@processInputs$OUTPUT_TYPE) && .Object@processInputs$OUTPUT_TYPE=="geotiff") {
resOut <- newXMLNode('wps:Output',attrs=c('asReference'='true','mimeType'='application/zip'))
} else {
resOut <- newXMLNode('wps:Output',attrs=c('asReference'='true'))
}
Expand Down
8 changes: 6 additions & 2 deletions demo/prism_subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ stencil <- simplegeom(data.frame('point1'=c(-89, 46), 'point2'=c(-78.6, 42.2)))

knife = webprocess(algorithm = list('OPeNDAP Subset'="gov.usgs.cida.gdp.wps.algorithm.FeatureCoverageOPeNDAPIntersectionAlgorithm"))

job <- geoknife(stencil,fabric, knife, wait = TRUE)
file <- download(job, destination = '../prism_data.nc')
job <- geoknife(stencil,fabric, knife, wait = TRUE, OUTPUT_TYPE="netcdf")
file <- download(job, destination = '../prism_data.nc')

knife = webprocess(algorithm = list('OPeNDAP Subset'="gov.usgs.cida.gdp.wps.algorithm.FeatureCoverageOPeNDAPIntersectionAlgorithm"))
job <- geoknife(stencil,fabric, knife, wait = TRUE, OUTPUT_TYPE="geotiff")
file <- download(job, destination = '../prism_data.zip')

0 comments on commit 9f66e3f

Please sign in to comment.