Repository navigation
[GH-3423] Split no-data replacement out of RS_SetBandNoDataValue into RS_ReplaceBandNoDataValue - #3424
Merged
Conversation
…e into RS_ReplaceBandNoDataValue Remove the 4-argument RS_SetBandNoDataValue(raster, band, noDataValue, replace) form and add RS_ReplaceBandNoDataValue(raster, band, noDataValue) for the replace behaviour: pixels holding the band's current no-data value are rewritten to the new value before it is declared, so they keep reading as no-data. RS_SetBandNoDataValue is metadata-only again. The Java method RasterBandEditors.setBandNoDataValue(raster, band, value, replace) becomes replaceBandNoDataValue(raster, band, value). SedonaDB is adding the same function (apache/sedona-db#1343), so both engines keep one API.
…a 2.0 migration guide
james-willis
force-pushed
the
jw/replace-band-nodata
branch
from
September 30, 2026 18:01
2b10f04 to
bef2cde
Compare
james-willis
marked this pull request as ready for review
September 30, 2026 18:11
jiayuasu
reviewed
Oct 1, 2026
# Conflicts: # docs/setup/migration-2.0.md # docs/setup/release-notes.md
jiayuasu
approved these changes
Oct 2, 2026
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.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes Split no-data replacement out of RS_SetBandNoDataValue into RS_ReplaceBandNoDataValue #3423What changes were proposed in this PR?
Give no-data replacement its own function instead of a boolean flag on
RS_SetBandNoDataValue. This is a breaking change aimed at 2.0.RS_SetBandNoDataValue(raster[, band], value)RS_SetBandNoDataValue(raster, band, value, true)RS_ReplaceBandNoDataValue(raster, band, value)RasterBandEditors.setBandNoDataValue(raster, band, value, replace)setBandNoDataValue(raster, band, value)/replaceBandNoDataValue(raster, band, value)The two modes were very different operations behind one signature. The flag turned a cheap metadata edit into a pixel rewrite, and it didn't combine with a
nullvalue, which means "remove the no-data value" everywhere else. SedonaDB is adding the same API. There, whether a function reads pixels is declared per function, so a flag would make everyRS_SetBandNoDataValuecall load pixels, and the reviewers on apache/sedona-db#1343 preferred a separate function. This PR makes the same split here so both engines keep one API.RS_ReplaceBandNoDataValuekeeps the oldreplace=truebehaviour:RasterUtils.isNoData: numeric comparison,-0.0matches0.0, and any NaN matches a NaN no-data value. That's the same rule SedonaDB uses.IllegalArgumentException.nullargument returnsnull.The NaN-to-integer error message in
RS_SetPixelTypenow recommends the new function.Unlike the other raster setters, the function takes only an explicit band. The existing 2-argument forms default to band 1 here but reject a multiband raster in SedonaDB, and a new function doesn't need to inherit that difference.
How was this patch tested?
RasterBandEditorsTest,RasterOutputTestandrasteralgebraTestmoved to the new function.nullpropagation-0.0matching a0.0no-data valueRasterBandEditorsTest,RasterBandAccessorsTest,RasterEditorsTestandRasterOutputTest(117 passing), plusrasteralgebraTest(174 passing). pre-commit is clean.Did this PR include necessary documentation updates?
vX.Y.Zformat.RS_ReplaceBandNoDataValuepage, plus a row in the raster function list.RS_SetBandNoDataValuepage drops thereplaceform and notes its removal inv2.0.0.trueandfalseforms.