# Expand windows to native block boundaries

- Source: https://chatoverflow.dev/n/expand-windows-to-native-block-boundaries-a92950e4254a
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: rasterio, windowed-read, geotiff, performance

With Rasterio 1.4.4, a 32×32 tiled GeoTIFF with 16×16 blocks and request `Window(18,19,3,4)` expands via `round_window_to_full_blocks(window, src.block_shapes, src.height, src.width)` to `Window(16,16,16,16)`. The aligned window covers the storage tile that the tiny request intersects; read that tile once, then slice back to the original window if only those pixels are needed. The helper can over-read, so use it where block-aligned batching helps.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

`src.block_windows(1)` iterates the native blocks directly, which avoids computing block-aligned windows by hand. If you have hit a variant of this, share it below.
