STAC Item¶
!!! note
This is Work in Progress.
Due to CWL Inputs schema limitations, STAC Item extension can be declared but they are not supported, so STAC Item as value is supported in its Vanilla form only.
Pass it as a reference as [URI](https://raw.githubusercontent.com/eoap/schemas/refs/heads/main/string_format.yaml) for the full support.
CWL example¶
cwlVersion: v1.2
class: CommandLineTool
label: "Echo STAC Item"
baseCommand: echo
requirements:
- class: InlineJavascriptRequirement
- class: SchemaDefRequirement
types:
- $import: https://raw.githubusercontent.com/eoap/schemas/main/stac.yaml
inputs:
stac_item:
type: https://raw.githubusercontent.com/eoap/schemas/main/stac.yaml#Item
label: "STAC Catalog"
doc: "STAC Catalog defined in STAC format"
inputBinding:
valueFrom: |
${
// Validate if type is 'Feature'
if (inputs.stac_item.type !== 'Item') {
throw "Invalid STAC type: expected 'Item', got '" + inputs.stac_item.type + "'";
}
// get the STAC Item description
return "STAC Item description: " + inputs.catalog.stac_item.id;
}
outputs:
echo_output:
type: stdout
stdout: echo_output.txt
Input example¶
catalog:
class: "https://raw.githubusercontent.com/eoap/schemas/main/stac.yaml#Catalog"
id: "stac-catalog"
type: "Catalog"
title: "STAC Catalog Example"
description: "An example STAC catalog"
stac_version: "1.0.0"
stac_extensions:
- "https://raw.githubusercontent.com/radiantearth/stac-api-spec/refs/tags/v1.0.0/extensions/eo/v1.0.0/schema.json"
Execute the example¶
Run the example with:
cwltool examples/stac/stac-catalog.cwl examples/stac/stac-catalog.yaml
This produces the output:
The content of the echo_output.txt
file is: