This PR adds functionality to convert the OS-C hazard inventory model to STAC.
OS-C hazard has a legacy custom JSON structure to describe an inventory of the indicators produced. For interoperatibility, there is a long standing goal of having these inventories be STAC-compliant. The goal of this PR is to support this option, while preserving the legacy behavior.
More specifically :
We add a to_stac_item(self) -> pystac.Item method to the HazardResource class.
We add a to_stac_items(self) -> List[pystac.Item] method to the HazardResources class.
In docs_store and the I/O methods that read/write inventories, we add a format option that takes by default the value 'osc' and optionally 'stac'.
We kept it as simple as possible with minimal coding, which means that the resulting STAC metadata is sub-optimal. Ideally, we would want one item to describe a single zarr array. Instead, one STAC item and its single asset map to one HazardResource, that may describe a group of zarr arrays. As a consequence, the asset of the item isn't pointing to an actual dataset, but displays the path to zarr arrays that has to be built with parameters and scenarios described in properties. This isn't how STAC is supposed to be used, but for now this will fulfill the basic requirement.
This PR adds functionality to convert the OS-C hazard inventory model to STAC.
OS-C hazard has a legacy custom JSON structure to describe an inventory of the indicators produced. For interoperatibility, there is a long standing goal of having these inventories be STAC-compliant. The goal of this PR is to support this option, while preserving the legacy behavior.
More specifically :
to_stac_item(self) -> pystac.Item
method to theHazardResource
class.to_stac_items(self) -> List[pystac.Item]
method to theHazardResources
class.docs_store
and the I/O methods that read/write inventories, we add aformat
option that takes by default the value'osc'
and optionally'stac'
.We kept it as simple as possible with minimal coding, which means that the resulting STAC metadata is sub-optimal. Ideally, we would want one item to describe a single zarr array. Instead, one STAC item and its single asset map to one
HazardResource
, that may describe a group of zarr arrays. As a consequence, the asset of the item isn't pointing to an actual dataset, but displays the path to zarr arrays that has to be built with parameters and scenarios described in properties. This isn't how STAC is supposed to be used, but for now this will fulfill the basic requirement.