NaN pixels in LERC tiles decode as 0
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 58/100
Research direction
Start in decode_lerc in src/decoder.rs, where the mask is discarded by let (data, _mask) = lerc::decode::<T>(...). Check how the mask is represented, then apply NaN only for float type parameters so integer decoding is unchanged. Reproduce with a 64×64 float32 LERC tile containing NaN pixels in tile (0, 0); done when those pixels decode as NaN instead of 0.
Written by the indexing model from the issue text.
Description
[!NOTE]
This issue was written by Claude (Claude Code), not by @kylebarron.
Summary
NaN pixels in float LERC tiles decode as 0.
LERC stores NaN as an invalid pixel in its mask rather than as a value. decode_lerc discards the mask (let (data, _mask) = lerc::decode::<T>(...)), and invalid pixels come back as 0. libtiff fills invalid float pixels with NaN (tif_lerc.c), so GDAL returns NaN.
Evidence
Two 64×64 float32 LERC files (little endian, max_z_error=0, 32×32 tiles) written by GDAL 3.12.1, with 35 NaN pixels in tile (0, 0):
| File | GDAL | async-tiff 0.7.0 |
|---|---|---|
| no nodata | 35 NaN | 0 NaN, 35 zeros |
nodata=NaN |
35 NaN | 0 NaN, 35 zeros |
Possible fix
For float data, set the pixels the LERC mask marks as invalid to NaN, as libtiff does.
deck.gl-raster's geotiff package has the same problem; see the linked deck.gl-raster issue.
🤖 Written by Claude Code
- Dominant language
- Rust
- Stars
- 125
- Forks
- 17
- Avg merge
- 7h 33m
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/async-tiff
-
Panic on TIFFs that omit the SamplesPerPixel tag (spec default is 1)Possibly taken @TomNicholas claimed this 130 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
developmentseed/async-tiff#318 ·
-
duplicate
Difficulty 3/5 1-2 days Newbie friendliness 57/100
developmentseed/async-tiff#376 · 1 comment ·
-
Claude suggestions for performance focusPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 8/100
developmentseed/async-tiff#352 · 1 comment · 2 reactions ·
-
Make abi3t wheelsOpen
Difficulty 3/5 Half a day Newbie friendliness 22/100
developmentseed/async-tiff#350 ·
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
developmentseed/async-tiff#344 · 4 comments · 1 reaction ·
All issues in developmentseed/async-tiff
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
storytold/craft-anything#2472 ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsotto/sotto-authenticator#68 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
slavakurilyak/awesome-ai-agents#1046 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nowledge-co/hawdb#1995 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swc-project/swc-next-issues#984 ·