[GH-3372] Allow NaN nodata in RS_AsRaster - #3384
Merged
jiayuasu merged 1 commit intoSep 22, 2026
Merged
Conversation
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?
Yes, I have read the Contributor Rules and Contributor Development Guide.
Is this PR related to a ticket?
Closes #3372.
What changes were proposed in this PR?
Allow NaN nodata values for float and double output in
RS_AsRaster, both when supplied explicitly and when inherited from the reference raster. Preserve rejection for integer pixel types, finite-value checks for burn values, and exact storage checks for finite nodata values.Infinity remains rejected: GeoTools cannot construct an infinite nodata category bound. This matches the existing infinite-nodata handling in
RS_FromGeoTiff. The API documentation now makes this distinction explicit.How was this patch tested?
On Windows with Java 17:
Both new NaN regression tests fail against unchanged upstream production code and pass with the fix. They verify background pixels, nodata metadata, and the count excluding nodata for F/D output.
Tests also cover inherited NaN rejection for integer bands, nonfinite integer nodata, infinite floating nodata, and nonfinite burn values.
All 128 tests in
RasterConstructorsTest,RasterizationTest,RasterBandAccessorsTest,RasterUtilsTest, andSerdeTestpass:mvn -pl common -am -Dtest=RasterConstructorsTest,RasterizationTest,RasterBandAccessorsTest,RasterUtilsTest,SerdeTest -Dsurefire.failIfNoSpecifiedTests=false testIncluding
RasterBandEditorsTestgives 146 passing tests and one existing failure intestClip: a Windows line-ending difference in GeoTools text output. The same failure was reproduced against unchanged upstream production code.Spotless and
git diff --checkpass.Spark and Python suites were not run locally.
Did this PR include necessary documentation updates?
Yes, the
RS_AsRasterdocumentation describes support for NaN nodata on F/D and the infinity restriction.