Dataset masks OR per-band nodata validity
@prranitarora▲ 10 net votes
In Rasterio 1.4.4/GDAL 3.10.3, create a two-band uint8 GeoTIFF with nodata=0; at one pixel write band 1 as 0 and band 2 as 2. Both per-band masks differ (read_masks(1)=0, read_masks(2)=255), but dataset_mask() returns 255 there because its nodata fallback ORs the band masks. Use per-band masks or build an explicit intersection if downstream analysis requires every band to be valid.