Experimental Process Inputs¶
CWL example¶
cwlVersion: v1.2
class: CommandLineTool
label: "geo API - Processes"
baseCommand: cat
requirements:
- class: InlineJavascriptRequirement
- class: SchemaDefRequirement
types:
- $import: https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml
- $import: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml
- $import: https://raw.githubusercontent.com/eoap/schemas/main/experimental/process.yaml
- class: InitialWorkDirRequirement
listing:
- entryname: inputs.yaml
entry: |-
$(inputs.api_endpoint.url.value)
---
$(inputs.execute_request.process_id)
---
$(inputs.execute_request.inputs)
inputs:
api_endpoint:
type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint
label: "OGC API endpoint"
doc: "OGC API endpoint for Landsat-9 data"
execute_request:
type: https://raw.githubusercontent.com/eoap/schemas/main/experimental/process.yaml#OGCExecuteProcessSettings
label: "OGC API Processes settings"
doc: "OGC API Processes settings for Landsat-9 data"
arguments:
- inputs.yaml
outputs:
echo_output:
type: stdout
stdout: process-output.yaml
Input example¶
api_endpoint:
url:
value: https://planetarycomputer.microsoft.com/api/ogc/processes/v1
headers: []
execute_request:
process_id: "water-body-detection"
inputs:
item:
class: "https://raw.githubusercontent.com/eoap/schemas/main/url.yaml#URL"
value: "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2/items/LC08_L2SP_042033_20231007_02_T1"
aoi: "-118.985,38.432,-118.183,38.938"
bands:
- "green"
- "nir08"
epsg: "EPSG:4326"
Execute the example¶
Run the example with:
cwltool examples/experimental/process.cwl examples/experimental/process.yaml
This produces the output:
INFO /opt/hostedtoolcache/Python/3.13.5/x64/bin/cwltool 3.1.20250715140722
INFO Resolved '../../examples/experimental/process.cwl' to 'file:///home/runner/work/schemas/schemas/examples/experimental/process.cwl'
INFO [job process.cwl] /tmp/q3dfqmpf$ cat \
inputs.yaml > /tmp/q3dfqmpf/process-output.yaml
INFO [job process.cwl] completed success
INFO Final process status is success
The content of the echo_output.txt
file is:
https://planetarycomputer.microsoft.com/api/ogc/processes/v1
---
water-body-detection
---
{"aoi": "-118.985,38.432,-118.183,38.938", "bands": ["green", "nir08"], "epsg": "EPSG:4326", "item": {"class": "https://raw.githubusercontent.com/eoap/schemas/main/url.yaml#URL", "value": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2/items/LC08_L2SP_042033_20231007_02_T1"}}