Skip to content

Running an OGC API Process with ZOO-Project

To invoke the OGC API process, follow these steps:

  1. Define the input parameters in YAML Create a parameter file named params.yaml:
params.yaml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
stac_api_endpoint:
  url:
    value: https://planetarycomputer.microsoft.com/api/stac/v1
  headers: []

search_request:
  collections: 
  - landsat-c2-l2
  datetime_interval:
    start:
      value: "2023-10-14T18:00:00"
    end:
      value: "2023-10-21T18:59:59"
  bbox: 
  - -121.399
  - 39.834
  - -120.74
  - 40.472

  filter-lang: cql2-json
  filter:
    {
        "op": "and",
        "args":
          [
            { "op": "<=", "args": [{ "property": "eo:cloud_cover" }, 70] },
            { "op": ">=", "args": [{ "property": "eo:cloud_cover" }, 0] },
            { "op": "eq" , "args": [{ "property": "proj:epsg"}, 32610]}
          ],
      }


processes_api_endpoint:
  url:
    value: http://zoo-project-dru-service/acme/ogc-api/
  headers: []

execute_request:
  process_id: "water-bodies"
  inputs:
    aoi: "-121.399,39.834,-120.74,40.472"
    bands:
    - "green"
    - "nir08"
    epsg: "EPSG:4326"
  1. Run the application package Execute the process with cwltool:
cwltool --debug cwl-workflows/eoap-api-cli.cwl#eoap-api cwl-workflows/params.yaml 
  1. Inspect the results The output is stored as a feature collection:
cat cwl-workflows/feature-collection.json
  1. Retrieve one of the generated assets Extract the root link from the feature collection, download the results, and display the directory tree:
results=$(jq -r '.features[0].links[] | select(.rel=="root") | .href' cwl-workflows/feature-collection.json | sed 's|/catalog.json$|/|')

aws s3 cp --recursive $results ./results/

tree results

Expected output

You should see logs of downloaded files followed by the resulting directory structure. For example:

download: s3://results/.../LC08_L2SP_043033_20231014_02_T1.json to results/.../LC08_L2SP_043033_20231014_02_T1.json
download: s3://results/.../otsu.tif to results/.../otsu.tif
download: s3://results/.../catalog.json to results/catalog.json
download: s3://results/.../collection.json to results/.../collection.json
...

results/
|-- 932544e2-7f54-11f0-bd13-8a8eed839884
|   |-- LC08_L2SP_043033_20231014_02_T1
|   |   |-- LC08_L2SP_043033_20231014_02_T1.json
|   |   `-- otsu.tif
|   |-- LC08_L2SP_044032_20231021_02_T1
|   |   |-- LC08_L2SP_044032_20231021_02_T1.json
|   |   `-- otsu.tif
|   `-- collection.json
`-- catalog.json

3 directories, 6 files