earthdaily / earthdaily-python-client

EarthDaily python client
https://earthdaily.github.io/earthdaily-python-client/
MIT License
13 stars 7 forks source link

ValueError: chunks keys ('y', 'x') not found in data dimensions ('latitude', 'longitude', 'time') #110

Closed robmarkcole closed 2 weeks ago

robmarkcole commented 1 month ago

Search of

datacube = earthdaily.earthdatastore.datacube(
    items, 
    intersects=pivot, 
    assets=["blue", "green", "red", "nir"],
    resolution=10,
    crs="EPSG:4326",
).load()

Returns error:

ValueError: chunks keys ('y', 'x') not found in data dimensions ('latitude', 'longitude', 'time')

Reason: EPSG:4326 has no x,y dimensions, only latitude and longitude for odc stac. But Earthdaily is searching for x and y.

Workaround: use EPSG:3857

robmarkcole commented 2 weeks ago

The error is cleared but I have a different error - NoDataInBounds but this query is validated with 3857

import earthdaily

datacube = earthdaily.earthdatastore.datacube(
    items, 
    bbox=bbox,
    assets=["blue", "green", "red", "nir"],
    resolution=10,
    crs="EPSG:4326", # Error NoDataInBounds: No data found in bounds. Data variable: blue
    # crs="epsg:3857",  # Works, 7.2 sec
)
nkarasiak commented 2 weeks ago

Fixed by converting latitude/longittude to y,x. Can you confirm @robmarkcole ?

robmarkcole commented 2 weeks ago

My bbox - bbox = [-55.57156688186254, -13.036094955921214, -55.5165546572249, -12.991699609079191] should it be converted? Would it be safer just to accept a gdf?

nkarasiak commented 2 weeks ago

Eum seems ok, as I cannot reproduce, difficult to answer.

robmarkcole commented 2 weeks ago

Will create a fresh issue if I can create a reproducible example on public data