Skip to content

geotiff: read_geotiff_dask honours default max_pixels region cap (#1838)#1839

Open
brendancol wants to merge 1 commit into
mainfrom
issue-1838
Open

geotiff: read_geotiff_dask honours default max_pixels region cap (#1838)#1839
brendancol wants to merge 1 commit into
mainfrom
issue-1838

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Fixes #1838.

Summary

  • read_geotiff_dask documents that max_pixels=None uses the module default cap, but the up-front region guard at __init__.py:2462 gated on max_pixels is not None and silently skipped when None was passed.
  • Per-chunk reads already applied MAX_PIXELS_DEFAULT, and the VRT chunked path substituted the default before its up-front guard, so only the GeoTIFF dask path was inconsistent. Callers could construct a lazy graph far larger than the documented safety cap, with the oversize error deferred to compute time.
  • Substitute MAX_PIXELS_DEFAULT for None before the guard so eager, VRT, and dask paths share the same up-front safety semantics.

Test plan

  • New regression tests in test_dask_max_pixels_default_guard_1838.py cover the default-cap guard, the explicit-cap guard, and verify normal small reads are unaffected.
  • Related dask / max_pixels tests still pass (182 passed).

read_geotiff_dask documents that max_pixels=None uses the module
default cap, but the up-front region guard was gated on
max_pixels is not None and silently skipped when None was passed.
Per-chunk reads still applied MAX_PIXELS_DEFAULT, and the VRT chunked
path already substituted the default before its up-front guard, so
only the GeoTIFF dask path was inconsistent: callers could build a
lazy graph over a region far larger than the documented safety cap,
with the oversize error deferred to compute time.

Substitute MAX_PIXELS_DEFAULT for None before the guard so eager,
VRT, and dask paths share the same upfront safety semantics.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 14, 2026
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.

read_geotiff_dask skips default max_pixels region guard when max_pixels=None

1 participant