Skip to content

[SEDONA-724] Fix RS_ZonalStats and RS_ZonalStatsAll edge case bug #1871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 20, 2025

Conversation

furqaankhan
Copy link
Contributor

Did you read the Contributor Guide?

Is this PR related to a ticket?

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

What changes were proposed in this PR?

When the ROI barely intersects with the input raster's extent and the allTouched argument is false then this causes the pixel data to be empty. That breaks the zonalMode method which assumes there will be pixel data.

Add better error handling and a shortcut for RS_ZonalStatsAll to skip unnecessary stats compute (saves ~6% time).

How was this patch tested?

  • add unit tests

Did this PR include necessary documentation updates?

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

@jiayuasu jiayuasu added this to the sedona-1.8.0 milestone Mar 20, 2025
@jiayuasu jiayuasu merged commit c49c923 into apache:master Mar 20, 2025
39 checks passed
jiayuasu pushed a commit that referenced this pull request May 30, 2025
)

* fix: RS_ZonalStats and RS_ZonalStatsAll edge case

* fix: spotless

* change NaN to null

* fix spotless

* change all NaNs to nulls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants