Fix remote dask orientation handling for GeoTIFF reads#1802
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
ValueErrorguard inread_geotiff_dask()to reject remote sources withOrientation != 1when 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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