Skip to content

Fix remote dask orientation handling for GeoTIFF reads#1802

Merged
brendancol merged 1 commit into
mainfrom
issue-1794
May 13, 2026
Merged

Fix remote dask orientation handling for GeoTIFF reads#1802
brendancol merged 1 commit into
mainfrom
issue-1794

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #1794.\n\nAdds a guard so remote dask GeoTIFF reads do not bypass TIFF Orientation handling and return silently wrong chunks.\n\nTested: pytest xrspatial/geotiff/tests/test_http_dask_orientation_1794.py

@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 13, 2026
@brendancol brendancol requested a review from Copilot May 13, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a backend-parity bug in the GeoTIFF reader where remote Dask-chunked HTTP/fsspec reads could bypass TIFF Orientation (tag 274) handling, yielding silently incorrect pixel ordering compared to eager reads. It adds an explicit guard in the remote-metadata prefetch path so chunked remote reads fail fast (with a clear error) when Orientation is non-default, and adds a regression test.

Changes:

  • Add a ValueError guard in read_geotiff_dask() to reject remote sources with Orientation != 1 when using Dask chunking.
  • Add a new test that serves an oriented TIFF over a local HTTP range server and asserts open_geotiff(url, chunks=...) raises.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
xrspatial/geotiff/__init__.py Adds a fast-fail guard for non-default Orientation in the remote (HTTP/fsspec) metadata prefetch path used by Dask chunking.
xrspatial/geotiff/tests/test_http_dask_orientation_1794.py Regression test ensuring remote Dask reads do not silently bypass Orientation handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brendancol brendancol merged commit 02c5ea9 into main May 13, 2026
16 checks passed
brendancol added a commit that referenced this pull request May 13, 2026
Resolves conflict in xrspatial/geotiff/__init__.py: keeps the
`_read_vrt_dask` dispatch hook from the PR branch. All other
geotiff changes from main (#1791, #1793, #1801, #1802, #1803, #1804,
#1805, #1806) were already integrated into the working tree by the
prior 7329dd9 commit; this merge just records the parent so git
recognises the reconciliation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote dask GeoTIFF reads bypass TIFF Orientation handling

2 participants