Skip to content

Further decouple CubeMetadata from CollectionMetadata, and properly apply spatio-temporal filtering #949

Open

Description

@soxofaan

supporting issue for #827 and related

PR #541 (for issue #464) introduced CubeMetadata as a less confusing alternative to CollectionMetadata, to focus on the concrete metadata of a cube, instead of overall metadata of a whole collection.
But we're not there yet: CollectionMetadata is still too sticky/dominant.

for example:

cube = connection.load_collection(
    "SENTINEL2_L2A",
    spatial_extent={"west": 3, "south": 51, "east": 3.1, "north": 51.1},
    temporal_extent="2026-09",
    bands=["B03"]
)

While cube is a tiny slice of the whole SENTINEL2_L2A data set, cube.metadata still point directly to SENTINEL2_L2A metadata, e.g. visualizing cube.metadata will show the full metadata of SENTINEL2_L2A: all bands, whole world, whole time converage.

e.g.

>>> cube.metadata.temporal_dimension.extent
['2015-06-27T10:25:31Z', None]
>>> cube.metadata.spatial_dimensions[0].extent
[-180, 180]

Band handling works better however: cube.metadata.band_dimension.band_names shows just the selected band ['B03'], but the default visualization of the whole metadata object will show all bands

Next steps: further decouple CubeMetadata and CollectionMetadata

  • at least: load_collection and load_stac should zone in on CubeMetadata as soon as possible, instead of confusingly still attaching CollectionMetadata
  • possible/necessary to eliminate the inheritance relation (class CollectionMetadata(CubeMetadata))?

Activity

  1. soxofaan commented on Oct 5, 2026

    @soxofaan
    MemberAuthor

    problem: the apply_metadata UDF signature is defined in terms of CollectionMetadata instead of CubeMetadata (which would be more correct):

    def apply_metadata(metadata: CollectionMetadata, context: dict) -> CollectionMetadata:

    to be investigated how easy this signature can be updated in this context without breaking existing UDF handling

  2. added a commit that references this issue on Oct 6, 2026
  3. soxofaan commented on Oct 6, 2026

    @soxofaan
    MemberAuthor

    to be investigated how easy this signature can be updated in this context without breaking existing UDF handling

    the UDF detection logic in openeo-geopyspark only looks at function name apply_metadata and ignores the exact argument signatures, so it's safe to change the signature here

  4. added a commit that references this issue on Oct 6, 2026
  5. changed the title [-]Further decouple CubeMetadata from CollectionMetadata[/-] [+]Further decouple CubeMetadata from CollectionMetadata, and properly apply spatio-temporal filtering[/+] on Oct 7, 2026
  6. added 2 commits that reference this issue on Oct 8, 2026
  7. soxofaan commented on Oct 8, 2026

    @soxofaan
    MemberAuthor

    at least: load_collection and load_stac should zone in on CubeMetadata as soon as possible, instead of confusingly still attaching CollectionMetadata

    Already handled that with 43d53d6

  8. 9 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions