Skip to content

Commit

Permalink
Ogc api processes wrapper for the zoo project (#113)
Browse files Browse the repository at this point in the history
* address problem: parameter 'channels_rgb_red': the attribute 'value' must be set for non optional parameters

* change output from collection to single txt file

* update test

* correct test, reduce number of processes to around 100
  • Loading branch information
MarkusKonk committed May 8, 2024
1 parent b9f9ef3 commit e03f4d2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15,911 deletions.
2 changes: 1 addition & 1 deletion tools/zoo_project_ogc_api_processes/.shed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ owner: ecology
remote_repository_url: https://github.com/galaxyecology/tools-ecology/tree/master/tools/ogc_api_processes_wrapper
homepage_url: https://github.com/AquaINFRA/galaxy
long_description: |
This tool is a wrapper for OGC API Processes coming from the Zoo Project and was created using the OGC-API-Process2Galaxy tool (https://github.com/AquaINFRA/OGC-API-Process2Galaxy). Check the README in the repository for more information.
This tool is a wrapper for OGC API Processes (OTB) coming from the Zoo Project (https://zoo-project.github.io/docs/intro.html) and was created using the OGC-API-Process2Galaxy tool (https://github.com/AquaINFRA/OGC-API-Process2Galaxy). Check the README in the repository for more information.
type: unrestricted
auto_tool_repositories:
name_template: "{{ tool_id }}"
Expand Down
20 changes: 14 additions & 6 deletions tools/zoo_project_ogc_api_processes/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</citations>
</xml>
<xml name="help">
<help>This tool is a wrapper for OGC API Processes coming from the Zoo Project (https://zoo-project.github.io/docs/intro.html) and was created using the OGC-API-Process2Galaxy tool (https://github.com/AquaINFRA/OGC-API-Process2Galaxy). Check the README in the repository for more information.</help>
<help>This tool is a wrapper for OGC API Processes (OTB) coming from the Zoo Project (https://zoo-project.github.io/docs/intro.html) and was created using the OGC-API-Process2Galaxy tool (https://github.com/AquaINFRA/OGC-API-Process2Galaxy). Check the README in the repository for more information.</help>
</xml>
<xml name="tests">
<tests>
Expand All @@ -37,8 +37,12 @@
<param name="out" value="float"/>
<param name="ram" value="256"/>
<param name="exp" value="im1b3,im1b2,im1b1"/>
<param name="out_outformat" value="image/png"/>
<output_collection name="output_data" type="list" count="2"/>
<param name="out_outformat" value="image/tiff"/>
<output name="output_data">
<assert_contents>
<has_n_lines n="1"/>
</assert_contents>
</output>
</test>
<test>
<param name="select_process" value="OTB.MeanShiftSmoothing"/>
Expand All @@ -51,9 +55,13 @@
<param name="maxiter" value="100"/>
<param name="rangeramp" value="0"/>
<param name="modesearch" value="False"/>
<param name="fout_outformat" value="image/png"/>
<param name="foutpos_outformat" value="image/png"/>
<output_collection name="output_data" type="list" count="2"/>
<param name="fout_outformat" value="image/tiff"/>
<param name="foutpos_outformat" value="image/tiff"/>
<output name="output_data">
<assert_contents>
<has_n_lines n="2"/>
</assert_contents>
</output>
</test>
</tests>
</xml>
Expand Down
10 changes: 5 additions & 5 deletions tools/zoo_project_ogc_api_processes/ogc_api_processes_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ library("getopt")
cat("start generic wrapper service \n")

getParameters <- function(){
args <- commandArgs(trailingOnly = TRUE)
con <- file("inputs.json", "r")
line <- readLines(con, n = 1)
json <- fromJSON(line)
Expand Down Expand Up @@ -112,9 +111,9 @@ retrieveResults <- function(server, jobID, outputData) {
resultBody <- parseResponseBody(result$body)
urls <- unname(unlist(lapply(resultBody, function(x) x$href)))
urls_with_newline <- paste(urls, collapse = "\n")
sink(paste0(outputData, "_result_urls.txt"))
cat(urls_with_newline, "\n")
sink()
con <- file(outputData, "w")
writeLines(urls_with_newline, con = con)
close(con)
}
} else if (jobStatus == "failed") {
status <- jobStatus
Expand All @@ -141,7 +140,8 @@ server <- "https://ospd.geolabs.fr:8300/ogc-api/"

inputParameters <- getParameters()

outputLocation <- inputParameters$outputData
args <- commandArgs(trailingOnly = TRUE)
outputLocation <- args[2]

outputs <- getOutputs(inputParameters, outputLocation, server)

Expand Down
Loading

0 comments on commit e03f4d2

Please sign in to comment.