Skip to content

VRT source reads do not honor max_pixels safety limit #1796

Closed

Description

@brendancol

Describe the bug

read_vrt(..., max_pixels=...) caps the assembled VRT output and some resample intermediates, but it does not pass max_pixels into the source GeoTIFF reads. A VRT can request a small output or destination rect while forcing a much larger source SrcRect decode, bypassing the caller's safety budget.

Expected behavior

The max_pixels limit should apply to every materialized source window and intermediate created while reading a VRT, not just the final VRT output.

Screenshots

Not applicable.

Desktop

Not applicable.

Smartphone

Not applicable.

Additional context

The source read in xrspatial/geotiff/_vrt.py calls read_to_array(...) without forwarding max_pixels.

Activity

  1. added
    bugSomething isn't working
    oomOut-of-memory risk with large datasets
    input-validationInput validation and error messages
    on May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginput-validationInput validation and error messagesoomOut-of-memory risk with large datasets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions