openeo-python-client icon indicating copy to clipboard operation
openeo-python-client copied to clipboard

merge_cubes: merge metadata even without band_dimensions

Open VictorVerhaert opened this issue 7 months ago • 1 comments

related code: https://github.com/Open-EO/openeo-python-client/blob/77c3e87e44a199949306d230339a92863c96de40/openeo/rest/datacube.py#L2210-L2224

Currently if one or both of the cubes have missing band data the resulting metadata is set to None. Suggested approaches:

  1. cube1 has bands and cube2 has bands -> current implementation
  2. cube1 has bands but cube2 has no bands -> take over bands of cube1 (cube2 will be merged with overlap on all bands)
  3. cube1 has no bands but cube 2 has bands -> See step 2 I think
  4. both have no bands -> use metadata from first cube

If one of both cubes has none as metadata I think it is still safer to put the result to none as well

In a better scenario the extents of all dimensions are merged but that might be the scope of a separate issue rather than include it in this one.

VictorVerhaert avatar Jun 12 '25 12:06 VictorVerhaert

indeed, a first simple improvement would be to take the union of bands (unless neither sides have a band dimension)

soxofaan avatar Jun 18 '25 18:06 soxofaan