openforis / sepal

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

Add the opportunity to import custom classes in the classification panel #93

Closed 12rambau closed 3 years ago

12rambau commented 3 years ago

I was following a webinar on the classification tool.

First thing first, this is totaly awesome congrats to the developers!

Then comes the feature request, in the exercice we need to set all our legends by hand. on the other hand, FAO is populating the following webpage with all the subregional classes that can be used in a subregion with downloadable files.

Could it be possible, at the legend level to import a .csv (or any format that you see fit) instead of manually reintroduce all the classes ?

Capture d’écran 2021-04-06 à 19 45 13
aurelgrooves commented 3 years ago

it would be good include the option to import colors as well (columns with R,G,B) When you have many classes then you don't need to assign colors - these are also included in the FAO legend database

12rambau commented 3 years ago

it would be good include the option to import colors as well (columns with R,G,B) When you have many classes then you don't need to assign colors - these are also included in the FAO legend database

hexadecimal is even easier to handle

12rambau commented 3 years ago

After some discussion with Matieu and colleagues it has been decided to use an specific format to export classification legends from the FAO registry.

I will be a .csv file containing the following structure:

Value, ClassName, Red, Green, Blue, Alpha
0, NA, 255, 255, 255, 255

will it be ok for you to handle it ?

cdanielw commented 3 years ago

Try this out on the test server.

It'll do both the strange channel per column format as well as hex, css color names, rgb(n, n, n), hsv(n, n, n). Alpha channel will be ignored. The user will be able to pick which CSV column contains which piece of information. I'm provide reasonable default column mapping based on data type and column names.