When merging a datacube, the documentation says:
Data cubes with the dimensions x, y and t have the same dimension labels in x,y and t. There are two options:
- Keep the overlapping values separately in the merged data cube: An overlap resolver is not needed, but for each data cube you need to add a new dimension using add_dimension. The new dimensions must be equal, except that the labels for the new dimensions must differ by name. The merged data cube has the same dimensions and labels as the original data cubes, plus the dimension added with add_dimension, which has the two dimension labels after the merge.
When not using an overlap resolver I get:
java.lang.UnsupportedOperationException: The operator: null is not supported when merging cubes. Supported operators are: Set(subtract, min, divide, or, max, xor, multiply, add, sum, and, product).
When using an overlap resolver, I get:
java.lang.IllegalArgumentException: Merging cubes with an overlap resolver is only supported when band counts are the same. I got: 4 and 1.
Right now I use:
dc_wo_m: DataCube = dc_wo_resampled.add_dimension("source", "JRC", type="other") dc_optical_m: DataCube = dc_optical.add_dimension("source", "S2_L1C", type="other") dc_merged: DataCube = dc_optical_m.merge_cubes(dc_wo_m, overlap_resolver=processes.max)
to merge the datacubes. I also tried
overlap_resolver=None. The datacubes have different bands with the same xy resolution using
resample_cube_spatial. Any ideas?