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

#3144: MinResample / MaxResample: preserve NODATA correctly for double cell … #3155

Merged
merged 1 commit into from Nov 16, 2019
Merged

#3144: MinResample / MaxResample: preserve NODATA correctly for double cell … #3155

merged 1 commit into from Nov 16, 2019

Conversation

kervel
Copy link
Contributor

@kervel kervel commented Nov 15, 2019

Overview

The current code set NODATA for nodata cells, but NODATA is only valid for Int cell types. Double.NaN or doubleNODATA should be used for double cells
See #3144

Checklist

  • docs/CHANGELOG.rst updated, if necessary
  • Module Hierarcy updated, if necessary
  • docs guides update, if necessary
  • New user API has useful Scaladoc strings
  • Unit tests added for bug-fix or new feature

Demo

Optional. Screenshots/REPL

Notes

Closes #3144

@kervel kervel changed the title [WIP] #3144: MinResample / MaxResample: preserve NODATA correctly for double cell … #3144: MinResample / MaxResample: preserve NODATA correctly for double cell … Nov 15, 2019
@@ -40,7 +40,7 @@ class MaxResample(tile: Tile, extent: Extent, targetCS: CellSize)
// Double.NaN would *always* be max
if (isData(v)) math.max(currentMax, v) else currentMax
}
if (doubleMax == Double.MinValue) NODATA else doubleMax
if (doubleMax == Double.MinValue) doubleNODATA else doubleMax
Copy link
Member

Choose a reason for hiding this comment

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

😨

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not okay ?

…type.

The current code set NODATA for nodata cells, but NODATA is only valid for Int cell types. Double.NaN or doubleNODATA should be used for double cells
See #3144

Signed-off-by: Frank Dekervel <frank@kapernikov.com>
@kervel
Copy link
Contributor Author

kervel commented Nov 15, 2019

(oops i broke the tests, now the tests are fixed)

@echeipesh echeipesh merged commit 4b918e0 into locationtech:master Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pyramid.fromLayerRDD fails to respect NODATA values with ResampleMethods.Max
3 participants