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

Convert NODATA ByteConstantTile and ShortConstantCellType: unexpected result #3525

Closed
bossie opened this issue Oct 23, 2023 · 3 comments · Fixed by #3553
Closed

Convert NODATA ByteConstantTile and ShortConstantCellType: unexpected result #3525

bossie opened this issue Oct 23, 2023 · 3 comments · Fixed by #3553
Assignees
Labels

Comments

@bossie
Copy link

bossie commented Oct 23, 2023

Describe the bug

A NODATA ByteConstantTile that is converted to its own CellType, is no longer NODATA.

To Reproduce

import geotrellis.raster.{ByteConstantTile, byteNODATA}

val t = ByteConstantTile(byteNODATA, cols = 1, rows = 1)
assert(t.isNoDataTile)
assert(t.convert(t.cellType).isNoDataTile) // boom

Expected behavior

Seeing as the CellType doesn't change, this should be a no-op and the tile should remain NODATA.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

  • Java version: openjdk version "1.8.0_382"
  • Scala version: 2.12.15
  • GeoTrellis version: 3.6.0

Additional context

Add any other context about the problem here.

@pomadchin pomadchin added the bug label Oct 24, 2023
@pomadchin
Copy link
Member

pomadchin commented Oct 24, 2023

Thanks for reporting!

There is a bug in the NoData conversion. 👍 nice catch; wondering if any other cellTypes might be affected.

@moradology
Copy link
Contributor

Looked into this a small amount yesterday and it appears to be related to NoData in particular, so I'd guess this can happen in other contexts. Going to see about addressing this today

jdries added a commit to VitoTAP/geotrellis that referenced this issue Oct 10, 2024
jdries added a commit to VitoTAP/geotrellis that referenced this issue Oct 10, 2024
jdries added a commit to VitoTAP/geotrellis that referenced this issue Oct 10, 2024
@jdries
Copy link
Contributor

jdries commented Oct 10, 2024

@moradology I did a quick PR, I can expand it a bit further if you believe this general direction is fine.
We'd like to solve this one as it's a fairly important issue for correctness.

jdries added a commit to VitoTAP/geotrellis that referenced this issue Oct 10, 2024
jdries added a commit to Open-EO/openeo-geotrellis-extensions that referenced this issue Oct 11, 2024
jdries added a commit to Open-EO/openeo-geotrellis-extensions that referenced this issue Oct 11, 2024
@pomadchin pomadchin changed the title convert NODATA ByteConstantTile: unexpected result Convert NODATA ByteConstantTile and ShortConstantCellType: unexpected result Oct 28, 2024
@pomadchin pomadchin self-assigned this Oct 28, 2024
pomadchin added a commit that referenced this issue Oct 28, 2024
)

* ConstantTile with nodata: support correct celltype conversion
#3525

* Fix all of the constant cellType conversions

* CHANGELOG.md update
---------

Co-authored-by: Jeroen Dries <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants