hydromt icon indicating copy to clipboard operation
hydromt copied to clipboard

Loading raster data doesn't seem to work with webdav

Open jensdebruijn opened this issue 6 months ago • 1 comments

HydroMT version checks

  • [X] I have checked that this issue has not already been reported.
  • [X] I have checked that this bug exists on the latest version of HydroMT.

Reproducible Example

import hydromt
import fsspec
import rioxarray

data_catalog = hydromt.DataCatalog(data_libs=["data_catalog.yml"])

# This results in an error
# rasterio.errors.RasterioIOError: webdav+https://files.isric.org/soilgrids/latest/data/sand/sand_0-5cm_mean.vrt: No such file or directory
# soilgrids = data_catalog.get_rasterdataset("soilgrids_test")


# but using fsspec directly works
soilgrids = data_catalog.get_source("soilgrids_test")
with fsspec.open(
    soilgrids.path,
    mode="rb",
    base_url=soilgrids.storage_options["base_url"],
) as f:
    da = rioxarray.open_rasterio(
        f,
    ).squeeze(drop=True)

    print(da)

data_catalog.yml:

soilgrids_test: data_type: RasterDataset driver: raster filesystem: webdav path: webdav://soilgrids/latest/data/sand/sand_0-5cm_mean.vrt storage_options: base_url: https://files.isric.org

Current behaviour

The data doesn't load, but results in the following error:

rasterio.errors.RasterioIOError: webdav+https://files.isric.org/soilgrids/latest/data/sand/sand_0-5cm_mean.vrt: No such file or directory

Desired behaviour

The data is loaded using webdav

Additional context

No response

jensdebruijn avatar Aug 12 '24 12:08 jensdebruijn