locationtech / geotrellis

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

Mask/localMask converts celltype #3488

Closed jdries closed 1 year ago

jdries commented 1 year ago

Describe the bug

The geotrellis Mask operation: https://github.com/locationtech/geotrellis/blob/fa88aeddab0849cdb8f830d3747554bc7adceb1f/raster/src/main/scala/geotrellis/raster/mapalgebra/local/Mask.scala#L31

Does not preserve the celltype of the tile that is masked, but rather converts the celltype to the union of the two tiles. This happens because combine in ArrayTile takes the union of celltypes: https://github.com/locationtech/geotrellis/blob/fa62e3af41270e8c553f054aef1866648ed809c0/raster/src/main/scala/geotrellis/raster/ArrayTile.scala#L208

To Reproduce

Perform masking with two tiles with different celltype. Check the output celltype of the masked result.

Expected behavior

The celltype of the original tile is preserved.

Environment