Skip to content

geotiff: read_geotiff_dask does not support fsspec / cloud URIs #1749

@brendancol

Description

@brendancol

Describe the bug

read_geotiff_dask() falls through to _read_geo_info() for non-HTTP sources, and _read_geo_info() uses plain open(source, 'rb') at xrspatial/geotiff/__init__.py:480. That call cannot resolve fsspec URIs (s3://, gs://, az://, memory://), so the dask path raises FileNotFoundError before any chunk task is built.

The eager path (open_geotiff -> _read_to_array -> _make_source in _reader.py) does route through _make_source and handles fsspec URIs via _CloudSource. The dask metadata read does not.

Reproduction

import fsspec, xrspatial.geotiff as xg

# Put a TIFF in fsspec's memory filesystem
fs = fsspec.filesystem('memory')
with open('local.tif', 'rb') as f:
    fs.pipe_file('/test.tif', f.read())

xg.open_geotiff('memory:///test.tif')               # works
xg.open_geotiff('memory:///test.tif', chunks=2)     # FileNotFoundError

Expected behavior

Dask reads should support the same source schemes as eager reads. _read_geo_info should route through _make_source / _is_fsspec_uri so cloud and memory URIs resolve identically.

References

  • xrspatial/geotiff/__init__.py:1955 (dask path call site)
  • xrspatial/geotiff/__init__.py:480 (offending open() call)
  • xrspatial/geotiff/_reader.py:1020 (_make_source with fsspec branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions