Logo
  • Home

Tutorials

  • Overview
  • Your first custom-type input
  • GeoJSON
    • GeoJSON Point
      • CWL example
      • Input example
      • Execute the example
    • GeoJSON Feature
  • OGC Bounding Box
  • 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
  • GeoJSON
  • GeoJSON Point
  • Edit on eoap/schemas

GeoJSON Point¶

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 GeoJSON Point"
baseCommand: echo
requirements:
  - class: InlineJavascriptRequirement
  - class: SchemaDefRequirement
    types:
      - $import: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml
inputs:
  point_of_interest:
    type: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point
    label: "Point of Interest"
    doc: "Point of interest defined in GeoJSON format"
    inputBinding:
      valueFrom: |
        ${
          // Validate if type is 'Point'
          if (inputs.point_of_interest.type !== 'Point') {
            throw "Invalid GeoJSON type: expected 'Point', got '" + inputs.point_of_interest.type + "'";
          }
          var coordinates = inputs.point_of_interest.coordinates;

          return "Point Coordinates: " + coordinates.join(', ');
        }
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.

point_of_interest:
  class: https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Point
  type: Point
  coordinates:
    - 125.6
    - 10.1
  bbox:
    - 125.6
    - 10.1
    - 125.6
    - 10.1

Execute the example¶

Run the example with:

cwltool examples/geojson/point.cwl examples/geojson/point.yaml

This produces the output:

INFO /opt/hostedtoolcache/Python/3.12.14/x64/bin/cwltool 3.3.20260925135507
INFO Resolved '../../examples/geojson/point.cwl' to 'file:///home/runner/work/schemas/schemas/examples/geojson/point.cwl'
INFO [job point.cwl] /tmp/r6daa1wx$ echo \
    'Point Coordinates: 125.6, 10.1' > /tmp/r6daa1wx/echo_output.txt
INFO [job point.cwl] completed success
INFO Final process status is success

The content of the echo_output.txt file is:

Point Coordinates: 125.6, 10.1
Previous Next

Apache License, Version 2.0

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