Georef output contract: alpha band for grayscale, srcnodata as mask fallback (#56) - #79
Merged
NewGraphEnvironment merged 5 commits intoSep 29, 2026
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115csb82i78r86GWFzwPzis
161 of 182 calibration grayscale frames hold true black the old -dstnodata 0 output deleted (median 47 px, max 3.5% on roll bcb94081). The mask declined on 0 of 264 and 0 of 10,105 thumbnails, so the srcnodata fallback only reaches paths thumbnails cannot exercise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115csb82i78r86GWFzwPzis
…ined mask (#56) Grayscale now warps with -dstalpha like RGB: 2 bands, Gray + Alpha, no NoData, replacing 1 band with -dstnodata 0, which wrote genuine black inside the frame as nodata (161 of 182 calibration grayscale frames) and let the band count differ by platform (fly#68). fly_georef() no longer refuses mask = "border" with srcnodata. The warp options were always either/or, so srcnodata is now the documented fallback for frames whose mask declined (fly#69). georef_one() warns when a mask declines with no fallback, since that collar reaches the output as data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115csb82i78r86GWFzwPzis
… the source (#56) The old grayscale -dstnodata 0 path rewrote true black as 1 rather than deleting it: on the 182 calibration grayscale frames, 161 warped axis-aligned (up to 3.6%) and 41 at a 30-degree bearing (up to 0.26%), none deleted. The 0->1 shift #68 saw on Windows happens silently on sf's GDAL 3.8.5 too. The measurement script gains that output-side pass at both bearings; border-masking.md, CLAUDE.md and NEWS state the new contract (2 bands gray, 4 RGB, alpha only) and srcnodata as a fallback for a declined mask, each scoped to what was measured. The threshold calibration script now calls fly_georef_warp_opts() rather than copying the old vector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115csb82i78r86GWFzwPzis
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115csb82i78r86GWFzwPzis
NewGraphEnvironment
deleted the
56-georef-output-contract-a-real-alpha-band
branch
September 29, 2026 05:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fly_georef()output now gets-dstalpha. Grayscale goes from 1 band withNoData = 0to 2 bands, Gray + Alpha, no NoData. RGB stays 4.mask = "border"together withsrcnodatais now accepted.srcnodatabecomes the fallback for frames whose mask declined.fly_georef_warp_opts()was always anelse if, so the old refusal guarded a pair GDAL never received.georef_one()now warns when a mask declines and no fallback was given, because that frame's collar reaches the output as image data.Related Issues
alpha="YES", and grayscale frames then need republishing.What was measured
Measured on the 182 grayscale calibration thumbnails, on sf's GDAL 3.8.5. Producer:
data-raw/mask_measure-interior_zeros.R.-dstnodata 0pathTest plan
devtools::test(): 2585 pass, 0 fail, 0 warn (macOS)-srcnodataturns the fallback test red. Restoring-dstnodata 0next to the alpha band turns the collision test red on its values, not just on band count.pkgdown::check_pkgdown()cleantest-fly_georef_mask.Ris removed, and the test now asserts 2 grayscale bands on every runner. Windows is the real test of Masking adds a band on Windows for grayscale, so "output band counts do not change" is platform-conditional #68.Notes
/code-checkran 3 rounds on the code commit and 3 on the docs and measurement commit. Every finding in both loops was prose or measurement scope, and all were fixed. The docs loop ended by enumerating 30 claims. Review under-counted twice: first the source-side count, then a single bearing. The archive README keeps both wrong turns./gh-pr-merge. The change is breaking and pre-1.0, so it should be a minor bump.🤖 Generated with Claude Code
https://claude.ai/code/session_0115csb82i78r86GWFzwPzis