geosolutions-it / jai-ext

Java Advanced Imaging Open Source Replacement Wannabe
Apache License 2.0
89 stars 38 forks source link

Adding minx/max operations to algebra operator. Ignore nodata values #297

Closed aaime closed 1 month ago

aaime commented 1 month ago

Besides adding a min and a max operator, I've also modified a bit the operation behavior. In particular, the current code was passing nodata into the ops, but the ops have no notion of nodata to start with, and would treat it as a norma value.

This is strange per se, but lead to tiling issues when combined with the new min/max merge behaviors of mosaic. Say that a tile has two sources images do not fully overlap, one of them is expanded with nodata (e.g., -9999) causing the min to return -9999, while a nearby tile only matches one source data, and it returns the value from it, causing a sudden output value jump.

With the current approach, there are no sudden jumps, only valid values are used to compute the output keeping the results stable.