openeo-python-client
openeo-python-client copied to clipboard
merge_cubes: merge metadata even without band_dimensions
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:
- cube1 has bands and cube2 has bands -> current implementation
- cube1 has bands but cube2 has no bands -> take over bands of cube1 (cube2 will be merged with overlap on all bands)
- cube1 has no bands but cube 2 has bands -> See step 2 I think
- 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.
indeed, a first simple improvement would be to take the union of bands (unless neither sides have a band dimension)