You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GeoTIFF write: NaN cells in a UInt8 raster without no-data are saved as 0 with no notice #2665
crates/data/src/raster/geotiff.rs: on the write path, fits_bytes accepts non-finite cells (!r.is_valid(v)) even when the raster has no no-data value, and the bytes closure in encode then writes them as nodata.unwrap_or(0). So a UInt8 or categorical raster with NaN cells and no no-data value is saved with those cells as 0, with no notice and no GDAL_NODATA tag. That is silent data loss under AGENTS.md's never-silent rule, so it shouldn't wait for a release quality pass.
The write_all fallback already guards this case (marked: r.nodata.is_some() || r.is_valid(v) in as_bytes); fits_bytes should do the same, so such a raster is written in a wider type (or with a no-data value and a notice) instead of becoming 0.
fits_bytes refuses non-finite cells when the raster has no no-data value
Regression test: a UInt8 raster with NaN cells and no no-data value round-trips without turning them into 0 (or says so); a clean UInt8 raster gives no notice
From: #2650 review, found during the 2026-11 release quality sweep.
Activity
data: keep the opacity of an RGBA raster written as floats (opengeos#…
data: scale only valid alpha when writing floats (opengeos#2665)
docs(data): a cloud-optimised file keeps only NaN as no value (openge…
data: keep an opaque alpha apart from the no-data value when writing …
data: skip the no-data scan where alpha can't collide (opengeos#2665)
fix(data): an RGBA GeoTIFF with a NaN colour under an opaque alpha is…