Skip to content
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

merge_cubes with different dimensions (but overlapping x, y, t and bands) fails with server 500 error #68

Open
Jaapel opened this issue Aug 16, 2021 · 5 comments
Labels
bug Something isn't working enhancement New feature or request processes

Comments

@Jaapel
Copy link

Jaapel commented Aug 16, 2021

When trying to merge 4 cubes over a short test time-period (see python client code example) I get OpenEoApiError: [500] Internal: Server error: Image.select: Parameter 'input' is required.

Clearly this calls the GEE backend in some way that was not expected. Am I missing something

from openeo import connect, Connection
from openeo.rest.datacube import DataCube
from typing import List, Dict, Tuple, Union
import pathlib

ee_url: str = "https://earthengine.openeo.org"
con: Connection = connect(ee_url).authenticate_basic(username="group1", password="test123")

out_dir = pathlib.Path("output")
out_dir.mkdir(parents=True, exist_ok=True)

# Get the collections needed
collections: List[Tuple[Union[str, List[str]]]] = [
        ('LANDSAT/LT4_L1T_TOA', ['B5', 'B2']),
        ('LANDSAT/LT5_L1T_TOA', ['B5', 'B2']),
        ('LANDSAT/LE7_L1T_TOA', ['B5', 'B2']),
        ('LANDSAT/LC8_L1T_TOA', ['B6', 'B3'])
    ]
# Define constraints for loading
spain_bounding_box: Dict[str, float] = {"west": -9.39288367353, "south": 35.946850084, "east": 3.03948408368, "north": 43.7483377142}
temporal_extent: List[str] = ["2021-04-26", "2021-04-30"]

combined_tiff_filename: str = "combined.tiff"

# Get and merge collections
for i, cl in enumerate(collections):
    if not collections: raise RuntimeError("please list wetness collection")
    dc: DataCube = con.load_collection(
        collection_id=cl[0],
        spatial_extent=spain_bounding_box,
        temporal_extent=temporal_extent,
        bands=cl[1]
    ).add_dimension(name="source_name", label=cl[0], type="other")  #TODO: add dimensional gives 500 error
    if i==0:
        combined_dc: DataCube = dc
    else:
        combined_dc: DataCube = combined_dc.merge_cubes(dc)

combined_dc.download(out_dir / combined_tiff_filename, format="GTIFF-THUMB")
@m-mohr m-mohr self-assigned this Aug 16, 2021
@Jaapel
Copy link
Author

Jaapel commented Aug 16, 2021

@m-mohr Updated comment as I posted the unedited version by accident.

@m-mohr
Copy link
Member

m-mohr commented Aug 16, 2021

I'll try to look into this, but can't promise anything right now. This driver is mostly unmaintained, unfortunately, due to the lack of funding / interest from Google itself.

@Jaapel
Copy link
Author

Jaapel commented Aug 16, 2021

Good to know! And many thanks!

@m-mohr
Copy link
Member

m-mohr commented Aug 17, 2021

Had a quick look, but doesn't seem to be easy to fix. The colleagues from TU Vienna are not working on openEO any longer so I doubt this will receive a fix. The merge_cubes implementation seems pretty basic right now. I'm sorry about that.

@Jaapel
Copy link
Author

Jaapel commented Aug 18, 2021

Thanks for letting me know. I will have a look at alternatives 👍 .

@m-mohr m-mohr removed their assignment Aug 26, 2021
@m-mohr m-mohr added processes bug Something isn't working enhancement New feature or request labels Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request processes
Projects
None yet
Development

No branches or pull requests

2 participants