Skip to content
Snippets Groups Projects
Commit e705ca2f authored by Lorenz Gruber's avatar Lorenz Gruber
Browse files

testing strong types with cwl

parent 8a5b5929
No related branches found
No related tags found
No related merge requests found
Pipeline #69200 passed
cwlVersion: v1.2
types:
- name: GeoTIFF
type: record # Must be a record type
fields:
- name: file
type: File
- name: Shapefile
type: record
fields:
- name: shp
type: File
doc: "The main Shapefile (.shp)"
- name: shx
type: File
doc: "The shape index file (.shx)"
- name: dbf
type: File
doc: "The attribute data file (.dbf)"
- name: prj
type: File
doc: "The projection file (.prj)"
- name: cpg
type: File?
doc: "The character encoding file (.cpg) (optional)"
- name: qpj
type: File?
doc: "The additional projection file (.qpj) (optional)"
{ {
"vector_input":{ "vector_input":{
"class": "File", "class": "File",
"path": "/home/lolo/Documents/fishnet/data/samples/Corvara_IT.tiff", "path": "/home/lolo/Documents/fishnet/data/samples/Corvara_IT.tiff"
}, },
"config":{ "config":{
"class":"File", "class":"File",
......
{
"config": {
"analysis-output-stem": "Analysis",
"binary-filters": [
{
"name": "InsidePolygonFilter"
}
],
"centrality-measures": [
{
"name": "DegreeCentrality"
},
{
"name": "MeanLocalSignificance"
},
{
"name": "SmallerNeighboursRatio"
}
],
"cleanup": true,
"concurrent-runs": true,
"contraction-output-stem": "Contraction",
"contraction-predicates": [
{
"distance": 500.0,
"name": "DistanceBiPredicate"
}
],
"executor": {
"cwl-directory": "/home/lolo/Documents/fishnet/cwl/sda",
"flags": "--quiet --no-container",
"name": "CWLTOOL"
},
"hardware-concurrency": 0,
"last-job-type": "MERGE",
"maxDistanceMeters": 3000.0,
"maxNeighbours": 5,
"memgraph-host": "localhost",
"memgraph-port": 7687,
"merge-workers": 2,
"neighbouring-files-predicate": "WSF",
"neighbouring-predicates": [],
"splits": 0,
"unary-filters": [
{
"name": "ApproxAreaFilter",
"requiredArea": 5000.0
}
],
"visualize-edges": true
},
"duration[s]": 0.032306679,
"input": "Corvara_IT.shp",
"output": "Corvara_IT_filtered.shp",
"polygon count": 26,
"type": "FILTER"
}
File added
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
\ No newline at end of file
File added
File added
cwlVersion: v1.2
class: CommandLineTool
baseCommand: [SettlementDelineationFilter]
requirements:
InlineJavascriptRequirement: {}
inputs:
gisFile:
type:
- $import: ../GIS.yml#GeoTIFF
- $import: ../GIS.yml#Shapefile
inputBinding:
position: 1
prefix: --input
valueFrom: $(self.file) # Correctly reference the GeoTIFF file
config:
type: File
doc: "Configuration file for filter process"
inputBinding:
prefix: --config
position: 2
outputs:
standardOut:
type: stdout
errorOut:
type: stderr
outFile:
type: ../GIS.yml#Shapefile
outputBinding:
glob: "*_filtered.shp" # Ensure we find the shapefile output
outputEval: |
${
if (self.length === 0) {
throw new Error("No filtered shapefile found.");
}
var shpFile = self[0]; // The matched .shp file
var baseName = shpFile.nameroot; // Remove .shp extension
return {
"shp": shpFile,
"shx": self.find(function(f) { return f.basename === baseName + ".shx"; }) || null,
"dbf": self.find(function(f) { return f.basename === baseName + ".dbf"; }) || null,
"prj": self.find(function(f) { return f.basename === baseName + ".prj"; }) || null,
"cpg": self.find(function(f) { return f.basename === baseName + ".cpg"; }) || null,
"qpj": self.find(function(f) { return f.basename === baseName + ".qpj"; }) || null
};
}
stderr: Filter_stderr.log
{
"gisFile":{
"class": "GeoTIFF",
"file":{
"class": "File",
"path": "/home/lolo/Documents/fishnet/data/samples/Corvara_IT.tiff"
}
},
"config":{
"class":"File",
"path": "/home/lolo/Documents/fishnet/prod/local/sda-workflow-local.json"
}
}
\ No newline at end of file
cwlVersion: v1.2
name: Shapefile
type: record
fields:
- name: shp
type: File
doc: "The main Shapefile (.shp)"
- name: shx
type: File
doc: "The shape index file (.shx)"
- name: dbf
type: File
doc: "The attribute data file (.dbf)"
- name: prj
type: File
doc: "The projection file (.prj)"
- name: cpg
type: File?
doc: "The character encoding file (.cpg) (optional)"
- name: qpj
type: File?
doc: "The additional projection file (.qpj) (optional)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment