openforis / sepal

Geographical Data Processing in the Cloud
https://sepal.io/
MIT License
207 stars 46 forks source link

impossible to create a categorical palette from distinct value if they are not contiguous #125

Closed 12rambau closed 3 years ago

12rambau commented 3 years ago

Describe the bug when you compute the categorical values from existing raster value (to create a custom palette in the maps interface) if the values are not continuous every values between categorical are selected. In my example the only available values are 45 and 53, the rest is noise.

To Reproduce In the map interface, load the following asset: users/bornToBeAlive/clc3class_reclass_github

Then in the maps inteface choose the categorical values and load a preset of values from "distinct values"

Expected behavior

Everything between extreme values is populated, I would expect to only see the used one. (i.e. hist > 0) A clear and concise description of what you expected to happen.

Screenshots

Capture d’écran 2021-07-28 à 11 09 47
12rambau commented 3 years ago

Capture d’écran 2021-08-05 à 14 54 45 As mentioned by @cdanielw in MP the problem was coming from the pyramidingPolicy of the asset.

Setting it to : pyramidingPolicy: {'.default': 'mode'} solved the issue

I'm not sure we want to handle categorical files that use mean as pyramidingPolicyso I'm closing this issue for now