Logo
  • Home

Tutorials

  • Overview
  • Your first custom-type input
  • GeoJSON
    • GeoJSON Point
    • GeoJSON Feature
  • OGC Bounding Box
    • CWL Example
    • Input example
    • Execute the example
  • STAC
    • STAC Catalog
    • STAC Collection
    • STAC Item
  • String formats
    • Datetime
    • URI
  • Experimental
    • Experimental Discovery Inputs
    • Experimental Process Inputs

How-to guides

  • Overview
  • Use an existing schema
  • Define new types

Reference

  • Overview
  • GeoJSON
    • Types
    • Schema details
  • OGC API Processes
    • Types
    • Schema details
  • STAC
    • Types
    • Schema details
  • String formats
    • Types
    • Schema details

Explanation

  • Custom types and their limits
EOAP schemas
  • Tutorials
  • OGC Bounding Box
  • Edit on eoap/schemas

OGC Bounding Box¶

CWL Example¶

# Copyright 2025 Terradue
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cwlVersion: v1.2
class: CommandLineTool
label: "Echo OGC BBox"
baseCommand: echo
requirements:
  - class: InlineJavascriptRequirement
  - class: SchemaDefRequirement
    types:
      - $import: https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml
inputs:
  aoi:
    type: https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#BBox
    label: "Area of interest"
    doc: "Area of interest defined as a bounding box"
    inputBinding:
      valueFrom: |
        ${
          // Validate the length of bbox to be either 4 or 6
          var bboxLength = inputs.aoi.bbox.length;
          if (bboxLength !== 4 && bboxLength !== 6) {
            throw "Invalid bbox length: bbox must have either 4 or 6 elements.";
          }
          // Convert bbox array to a space-separated string for echo
          return inputs.aoi.bbox.join(' ') + " CRS: " + inputs.aoi.crs;
        }
outputs:
  echo_output:
    type: stdout
stdout: echo_output.txt

Input example¶

# Copyright 2025 Terradue
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

aoi:
  class: "https://raw.githubusercontent.com/eoap/schemas/main/ogc.yaml#BBox"
  bbox: [100.0, 0.0, 101.0, 1.0]
  crs: "CRS84"

Execute the example¶

Run the example with:

cwltool examples/ogc/bbox.cwl examples/ogc/bbox.yaml > output.json

This produces the output:

INFO /opt/hostedtoolcache/Python/3.12.14/x64/bin/cwltool 3.3.20260925135507
INFO Resolved '../../examples/ogc/bbox.cwl' to 'file:///home/runner/work/schemas/schemas/examples/ogc/bbox.cwl'
INFO [job bbox.cwl] /tmp/wfsexbxo$ echo \
    '100 0 101 1 CRS: CRS84' > /tmp/wfsexbxo/echo_output.txt
INFO [job bbox.cwl] completed success
INFO Final process status is success

The content of the echo_output.txt file is:

100 0 101 1 CRS: CRS84
Previous Next

Apache License, Version 2.0

Built with MkDocs using a theme provided by Read the Docs.
eoap/schemas « Previous Next »