Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.