prantogg opened a new pull request, #2958:
URL: https://github.com/apache/sedona/pull/2958

   ## Did you read the Contributor Guide?
   
   - Yes, I have read the [Contributor 
Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor 
Development Guide](https://sedona.apache.org/latest/community/develop/)
   
   ## Is this PR related to a ticket?
   
   - No
   
   ## 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to