Closed VictorVerhaert closed 3 months ago
as discussed, a workaround would be to keep the openeo package below 0.29 for now
Another workaround is to add the following:
cube.metadata = cube.metadata.add_dimension("t", label=None, type="temporal")
Started with a PR at #568
I already merged an initial fix that avoids throwing the MetadataException
, so at least that can already be included in the next release
next steps are properly detecting real properties of the temporal dimension
@soxofaan @VictorVerhaert this method parses already correctly the dimensions, why not re using that? It seems we are trying to re-implement something that already exists: https://github.com/Open-EO/openeo-python-client/blob/3c6045b6f0215455609599a868340cc52cddf86c/openeo/metadata.py#L413
@soxofaan I created a PR here: https://github.com/Open-EO/openeo-python-client/pull/591 . Currently it solves the issue I have, but there are probably other scenarios that could be covered (currently it makes only a difference for STAC Collections having cube:dimensions
available.
I think this can now be closed with #591 being merged
When using load_stac, the python client tries to read metadata from the provided stac. The only metadata currently being read is bands, so no spatial or temporal metadata.
When the python client fails to read metadata from the stac, metadata is simply set to None. These lines check is metadata is present and have default behaviour otherwise: https://github.com/Open-EO/openeo-python-client/blob/36ecc2bdb0feaf4b7876819946866bd651a18189/openeo/rest/datacube.py#L1350-L1359 and https://github.com/Open-EO/openeo-python-client/blob/36ecc2bdb0feaf4b7876819946866bd651a18189/openeo/rest/datacube.py#L1216
The problem arises however when metadata IS being read from the STAC. As only bands are read
cube.metadata
is not None, but it does not contain a temporal dimension resulting in a MetadataException originating for example from: https://github.com/Open-EO/openeo-python-client/blob/36ecc2bdb0feaf4b7876819946866bd651a18189/openeo/metadata.py#L271-L275The solution is threefold I think: