Skip to content
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

[SEDONA-515] Add handling of noDataValues in RS_Resample #1279

Merged
merged 5 commits into from
Mar 15, 2024

Conversation

prantogg
Copy link
Contributor

@prantogg prantogg commented Mar 14, 2024

Did you read the Contributor Guide?

Is this PR related to a JIRA ticket?

What changes were proposed in this PR?

Resolves #1245 .Adds handling of noDataValue for bilinear and bicubic algorithms of RS_Resample as follows.

  • Extracts a noDataValue mask from the original raster.
  • Replaces noDataValues in original raster with median of neighbors.
  • Performs resampling on noDataValue mask and updated raster separately.
  • To replant noDataValues - superimposes resampled noDataValue mask onto resampled raster

How was this patch tested?

  • Passes new and existing tests

Did this PR include necessary documentation updates?

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

raster = MapAlgebra.addBandFromArray(raster, values1, 1, 99.0);
raster = MapAlgebra.addBandFromArray(raster, values2, 2, -9999.0);

GridCoverage2D newRaster = RasterEditors.resample(raster, 6, 5, 1, -1, false, "bilinear");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test to downsample the raster? E.g., the original raster is 4, 3, resample it to 2, 2?

@prantogg prantogg requested a review from jiayuasu March 15, 2024 18:34
@jiayuasu jiayuasu added this to the sedona-1.6.0 milestone Mar 15, 2024
@jiayuasu jiayuasu merged commit 98da1d7 into apache:master Mar 15, 2024
48 checks passed
jiayuasu pushed a commit that referenced this pull request Apr 28, 2024
* test

* feat: Add handling for noDataValues

* Update imports

* Update imports

* Add tests; Update mean to median
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants