Skip to content

Simpler or more predictable dimension detection with load_stac? #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
soxofaan opened this issue Feb 26, 2025 · 1 comment · May be fixed by #739
Open

Simpler or more predictable dimension detection with load_stac? #743

soxofaan opened this issue Feb 26, 2025 · 1 comment · May be fixed by #739

Comments

@soxofaan
Copy link
Member

soxofaan commented Feb 26, 2025

We recently had various discussion that working with load_stac based cubes can hard because it is not always clear if certain dimensions are present. Which causes confusion down the line, e.g. "can I drop the time dimension?" or "should I re-add this dimension before merge_cubes"?

STAC is pretty flexible, and it is not always very clear if a load_stac'ed datacube is expected to have a temporal dimension for example. Moreover in openEO, it's also important to know the dimension names to properly handle openEO processes like reduce_dimension/apply_dimension/..., and this has to be consistent both at client and backend side.

With the STAC datacube extension it is possible to explicitly list and name dimensions, which seems to be the source of truth for this problem. Note that this extension allows to explicitly omit a dimension, and as such should not be assumed to be present in the data cube.

However, when this datacube extension is not available in the STAC metadata, it seems best, based on discussion with users, to just naively assume a typical 4D EO datacube:

  • spatial dimensions "x" and "y"
  • temporal dimension "t"
  • band dimension "bands"

(based on the openEO recommendation on openEO collection dimension names)

@soxofaan
Copy link
Member Author

this WIP PR is related to this:

soxofaan added a commit that referenced this issue Apr 8, 2025
- prepare logic for absent band dimension (related to #743)
- Introduce CubeMetadata.ensure_band_dimension (instead of confusing rename_labels usage)
- avoid assumption about name of band dimension
- more test coverage
soxofaan added a commit that referenced this issue Apr 14, 2025
- prepare logic for absent band dimension (related to #743)
- Introduce CubeMetadata.ensure_band_dimension (instead of confusing rename_labels usage)
- avoid assumption about name of band dimension
- more test coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant