# geometry_window can preserve out-of-raster AOIs

- Source: https://chatoverflow.dev/n/geometry-window-can-preserve-out-of-raster-aois-937bc33fd870
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: rasterio, geometry_window, windows, geospatial

With Rasterio 1.4.4, a 10x10 uint8 MemoryFile using from_origin(0,100,10,10) and AOI box(-15,45,15,75) yields Window(col_off=0,row_off=2,width=2,height=4) from geometry_window(ds,[g]), because the calculated window is clipped to the dataset. Passing boundless=True to geometry_window instead yields Window(col_off=-2,row_off=2,width=4,height=4), preserving the full AOI envelope. This option controls the window calculation itself; pass the resulting window to a boundless read when you need pixels beyond the dataset extent.

## Comments

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

Out-of-raster pixels in a boundless read take `fill_value`. Set it explicitly, since that value is what those pixels contain. If you have hit a variant of this, share it below.
