Skip to content

Latest commit

 

History

History
103 lines (72 loc) · 3.74 KB

README.md

File metadata and controls

103 lines (72 loc) · 3.74 KB

OGC Best Practice for Earth Observation Application Package Annex A examples

This repository contains the examples provided in the Annex A of the OGC Best Practice for Earth Observation Application Package.

The Annex A is available at the URL https://docs.ogc.org/bp/20-089r1.html#toc52

To run these examples you'll need:

  • a CWL runner, follow the instructions provided here: Installing a CWL runner
  • a container runtime such as docker or podman
  • a staged Sentinel-2 acquisition

Stage the Sentinel-2 data

Data stage-in is the process to retrieve the inputs and make these available for the processing. Processing inputs are provided as catalogue references and the Platform is responsible for translating those references into inputs available as files for the local processing.

The output of the data stage-in is a local STAC Catalog with a STAC Item whose Assets have an accessible href (either local or remote e.g. COG) as the input files manifest for the application.

Learn more about the Data Flow Management here.

This repository provides a simple Python script to stage a Sentinel-2 product from the Sentinel-2 Cloud-Optimized GeoTIFFs collection described here: https://registry.opendata.aws/sentinel-2-l2a-cogs/.

This Python script requires stac-asset and pystac, install these with:

pip install stac-asset pystac

Now stage the Sentinel-2 product in a folder named reference-data:

mkdir reference-data
cd reference-data
python ../stage.py https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a-cogs/items/S2B_53HPA_20210723_0_L2A

The output is:

$ tree reference-data/
reference-data/
├── catalog.json
└── S2B_53HPA_20210723_0_L2A
    ├── AOT.tif
    ├── B01.tif
    ├── B02.tif
    ├── B03.tif
    ├── B04.tif
    ├── B05.tif
    ├── B06.tif
    ├── B07.tif
    ├── B08.tif
    ├── B09.tif
    ├── B11.tif
    ├── B12.tif
    ├── B8A.tif
    ├── L2A_PVI.tif
    ├── metadata.xml
    ├── S2B_53HPA_20210723_0_L2A.json
    ├── SCL.tif
    ├── TCI.tif
    ├── tileInfo.json
    └── WVP.tif

1 directory, 21 files

Containers

The command line tools are containerized and the container images are available in this Github organization container registry.

D.1. Crop Application Example

This example crops a band from a Sentinel-2 product.

cwltool app-package.cwl#s2-cropper params.yml

D.2. Scatter Crop Application Example

This example extends the previous example with an Application Package that scatters the processing from an array of input values.

cwltool --parallel app-package-scatter.cwl#s2-cropper params.yml

D.3. Composite two-step Workflow Example

This example extends the previous example with an Application Package that is a two-step workflow that crops (using scatter over the bands) and creates a composite image.

cwltool  --parallel app-package-two-steps-rgb.cwl#s2-compositer params-rgb.yml 

D.4. Multiple Inputs Composite Two-step Workflow Example

This example extends the previous example by creating a workflow that takes a list of products as input and invokes a two-step sub-workflow that crops (using scatter over the bands) and creates a composite.

cwltool --parallel app-package-multiple-products.cwl#s2-composites params-multiple-products.yml