openforis/sepal_ui

raster layers cannot be added to the sepal map

Closed this issue · 0 comments

from pathlib import Path
from urllib.request import urlretrieve

rgb = Path("/tmp") / "rgb.tif"
link = "https://raw.githubusercontent.com/rasterio/rasterio/master/tests/data/RGB.byte.tif"
urlretrieve(link, file)


# open with rioxarray

da = rioxarray.open_rasterio(file, masked=True)
print(type(da))
da = da.chunk((100,1000))

returns

   1436 elif isinstance(chunks, tuple | list):
   1437     utils.emit_user_level_warning(
   1438         \"Supplying chunks as dimension-order tuples is deprecated. \"
   1439         \"It will raise an error in the future. Instead use a dict with dimension names as keys.\",
   1440         category=DeprecationWarning,
   1441     )
-> 1442     chunk_mapping = dict(zip(self.dims, chunks, strict=True))
   1443 else:
   1444     chunk_mapping = either_dict_or_kwargs(chunks, chunks_kwargs, \"chunk\")

ValueError: zip() argument 2 is shorter than argument 1"