Skip to content

[SEDONA-751] RS_Interpolate band index and noDataValue handling#2958

Open
prantogg wants to merge 1 commit into
apache:masterfrom
prantogg:pranav/bugfix/rs-interpolate-band-nodata
Open

[SEDONA-751] RS_Interpolate band index and noDataValue handling#2958
prantogg wants to merge 1 commit into
apache:masterfrom
prantogg:pranav/bugfix/rs-interpolate-band-nodata

Conversation

@prantogg
Copy link
Copy Markdown
Contributor

@prantogg prantogg commented May 16, 2026

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • Yes, and the PR name follows the format [SEDONA-XXX] my subject.

What changes were proposed in this PR?

Fixes two bugs in RS_Interpolate:

  1. Band index bug: When interpolating a specific band in a multi-band raster, non-interpolated bands were copied using the wrong index variable (band instead of bandIndex), causing incorrect data in the output raster.

  2. noDataValue NaN comparison bug: When noDataValue is NaN, the comparison interpolatedValue != noDataValue always returns true (since NaN != NaN in IEEE 754), causing countNoDataValues to be incorrectly decremented even when interpolation didn't produce a valid value. Fixed by using proper Double.isNaN() checks.

How was this patch tested?

Added testInterpolatePreservesOtherBands test that creates a 2-band raster, interpolates only band 1, and verifies band 2 is preserved unchanged. Existing interpolation tests continue to pass.

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

@prantogg prantogg changed the title fix: RS_Interpolate band index and noDataValue handling [SEDONA-751] RS_Interpolate band index and noDataValue handling May 16, 2026
@prantogg prantogg force-pushed the pranav/bugfix/rs-interpolate-band-nodata branch 2 times, most recently from b518f88 to 3a9890f Compare May 16, 2026 01:29
@prantogg prantogg force-pushed the pranav/bugfix/rs-interpolate-band-nodata branch from 3a9890f to 71111c3 Compare May 16, 2026 01:30
@prantogg prantogg marked this pull request as ready for review May 16, 2026 02:12
@prantogg prantogg requested a review from jiayuasu as a code owner May 16, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant