Producer¶
Application Package to produce a Zarr store with detected water bodies described as a STAC Collection including the STAC Datacube extension.
In [1]:
Copied!
from pathlib import Path
import sys
repo_root = next(
path for path in [Path.cwd(), *Path.cwd().parents]
if (path / "cwl-workflow/app-water-bodies.cwl").is_file()
)
sys.path.insert(0, str(repo_root / "docs"))
from helpers import WorkflowViewer
import cwl_loader
cwl_loader.logger.remove()
cwl_loader.logger.add(sys.stderr, level="INFO")
from pathlib import Path
import sys
repo_root = next(
path for path in [Path.cwd(), *Path.cwd().parents]
if (path / "cwl-workflow/app-water-bodies.cwl").is_file()
)
sys.path.insert(0, str(repo_root / "docs"))
from helpers import WorkflowViewer
import cwl_loader
cwl_loader.logger.remove()
cwl_loader.logger.add(sys.stderr, level="INFO")
Out[1]:
1
In [2]:
Copied!
wf = WorkflowViewer.from_file(
str(repo_root / "cwl-workflow/app-water-bodies.cwl"),
entrypoint="water-bodies",
)
wf = WorkflowViewer.from_file(
str(repo_root / "cwl-workflow/app-water-bodies.cwl"),
entrypoint="water-bodies",
)
Inputs¶
In [3]:
Copied!
wf.display_inputs()
wf.display_inputs()
| Id | Type | Label | Doc |
|---|---|---|---|
stac_api_endpoint |
Any |
STAC API endpoint | STAC API endpoint |
collection |
string |
STAC collection | STAC collection identifier |
aoi |
https://raw.githubusercontent.com/eoap/schemas/main/geojson.yaml#Polygon |
Area of interest | Area of interest polygon with bbox [minx, miny, maxx, maxy] |
start-datetime |
[ null, https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime ] |
Start time | Start time |
end-datetime |
[ null, https://raw.githubusercontent.com/eoap/schemas/main/string_format.yaml#DateTime ] |
End time | End time |
limit |
int |
limit | limit |
max-items |
int |
max-items | max-items |
filter-lang |
[ null, enum ] |
Filter language | Filter language |
filter |
[ null, Any ] |
Filter | Filter |
bands |
string[] |
bands used for the NDWI | bands used for the NDWI |
overview_levels |
int |
Number of Zarr overview levels | Number of multiscale overview levels generated by stac-zarr |
continuous_overview_reducer |
enum |
Overview reducer for continuous variables | Reducer used for continuous variables when generating overviews (mean, max, median, nearest) |
categorical_overview_reducer |
enum |
Overview reducer for categorical variables | Reducer used for categorical variables when generating overviews (mean, max, median, nearest) |
stac_object_type |
enum |
STAC object type | Output STAC object type emitted by stac-zarr (collection or item) |
Steps¶
In [4]:
Copied!
wf.display_steps()
wf.display_steps()
| Id | Runs | Label | Doc |
|---|---|---|---|
build_api_endpoint |
#build_api_endpoint |
Build STAC API endpoint | Normalize endpoint to APIEndpoint schema expected by discovery step |
build_search_request |
#build_search_request |
Build STAC search request | Build STACSearchSettings from AOI and query inputs |
discovery |
#stac-client |
STAC API discovery | Discover STAC items from a STAC API endpoint based on a search request |
convert_search |
#convert-search |
Convert Search | Convert Search results to get the item self hrefs and the area of interest |
water_bodies |
#detect_water_body |
Water bodies detection | Water bodies detection based on NDWI and otsu threshold applied to each STAC item (sub-workflow) |
stac-collection |
#stac-collection |
Create a STAC catalog with COG outputs | Create a STAC catalog with the detected water bodies COG outputs |
stac_eopf_product |
#stac-eopf-product |
Create a EOPF Zarr store from a STAC catalog | Create a EOPF Zarr store from a STAC catalog with COG products |
stac_zarr |
#stac-zarr |
Create a STAC Catalog for the Zarr store | Create a STAC Catalog for the Zarr store from the STAC catalog with COG outputs |
Outputs¶
In [5]:
Copied!
wf.display_outputs()
wf.display_outputs()
| Id | Type | Label | Doc |
|---|---|---|---|
zarr_stac_catalog |
Directory |
Zarr STAC catalog | STAC catalog produced by the stac-zarr step |
stac_catalog |
Directory |
Intermediate STAC catalog | STAC catalog produced by the stac-collection step |
eopf_product_stac_catalog |
Directory |
EOPF product STAC catalog | STAC catalog produced by the stac-eopf-product step |
Component diagram¶
In [6]:
Copied!
wf.display_components_diagram()
wf.display_components_diagram()
Class diagram¶
In [7]:
Copied!
wf.display_class_diagram()
wf.display_class_diagram()
In [ ]:
Copied!
S3 publication¶
The feature checkout adds an eoap-cwlwrap composition with the mastering stage-out tool. Use item-mode outputs, wrap the final Zarr catalog, stage complete stores to S3, and build a STAC GeoParquet metadata index. See Kubernetes publication.