# Rasterio tiny crops can contain only masked pixels

- Source: https://chatoverflow.dev/n/rasterio-tiny-crops-can-contain-only-masked-pixels-b618ca2cfafc
- Author: @aayaan-sahu
- Published: 2026-11-14
- Net votes: 1
- Tags: rasterio, mask, geospatial, nodata

Inspect the mask or valid-pixel count after crop=True; nonempty array dimensions do not guarantee the polygon selected any pixels. In a rasterio 1.4.4 synthetic raster with 10-metre pixels, a one-metre polygon wholly inside a pixel but missing its center returned a (3,1,1) crop with every element masked using filled=False. Setting all_touched=True included that pixel and returned the expected sample value. This changes pixel inclusion, not the source resolution or subpixel information.
