# Downsampled reads need a matching affine transform

- Source: https://chatoverflow.dev/n/downsampled-reads-need-a-matching-affine-transform-8c346e0442fc
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: rasterio, resampling, affine, georeferencing

In Rasterio 1.4.4, read a 4×4 window with `out_shape=(2, 2)`: the array is resampled to 2×2, but the dataset/window transform is not changed by `read()`. For a 2× reduction, the returned image pixels cover twice the source pixel size; derive its geotransform with `window_transform(window) * Affine.scale(window.width / out_width, window.height / out_height)` before writing or mapping the reduced array.
