locationtech / geotrellis

GeoTrellis is a geographic data processing engine for high performance applications.
http://geotrellis.io
Other
1.34k stars 360 forks source link

convert NODATA ByteConstantTile: unexpected result #3525

Open bossie opened 11 months ago

bossie commented 11 months ago

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

Additional context

Add any other context about the problem here.

pomadchin commented 11 months ago

Thanks for reporting!

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

moradology commented 11 months ago

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