GispoCoding / eis_toolkit

Python library for mineral prospectivity mapping
https://eis-he.eu/
European Union Public License 1.2
16 stars 6 forks source link

Add CBA CLI function #388

Closed nmaarnio closed 1 week ago

nmaarnio commented 2 weeks ago

Hey @AlVella , could you help with bringing this tool to the EIS QGIS Plugin? I think the best starting point is to think how should a processing algorithm in QGIS look like for this tool. I am having a little bit difficulties thinking how the column, subset_target_attribute_values, add_name and add_buffer parameters should be displayed in QGIS, since list parameters can be a bit tricky there. If you have any ideas regarding how the tool should look like in QGIS, or the CLI function (you can take a look at other CLI functions in cli.py of EIS Toolkit for examples), I would be glad to hear them. Just for clarification, how the tool pipeline goes is EIS Toolkit function -> EIS CLI function -> EIS QGIS processing algorithm -> EIS Wizard interface, and what exists now is just the first step.

nmaarnio commented 2 weeks ago

A simple, last-resort option is to just implement those parameters in the processing algorithm as LineEdit widgets where the user just has to know the right format, and the input text will be parsed with some logic.

AlVella commented 1 week ago

Hi Niko.

I think the minimum for this tool would be to have the possibility to create the CBA matrix with one layer, in which case the cell_size parameter could be a simple integer/float input, the column parameter could be a selection from a drop-down list of features from the selected input with the possibility to choose none. The subset_target_attribute_values should be optional and if possible a tickable list of unique values for this attribute (like the one for the "Fields to add" in the "Join Attribute by Location" tool) or a manuel text input. add_name and add_buffer would be optional text and integer/float input.

Adding more data to the matrix could be either another tool, with the same process for each data (except the cell size), or if integrated within the same tool, i think it would require a tabular entry. I don't know if it is possible in QGIS, but it was the least painful way i found when using Tkinter for a similar tool.

2024-05-21_11h24_14

I'ts a little bit janky in this example, but with tabular inputs, it should be possible to add multiple layer and add for each one the parameters (optional or not) without making it too difficult to understand for the user. I think this table could be under a spoiler ("add additional layer"), while the main layer (used for creating the grid) should be apart using the template described above.

The resulting table could look similar to the one shown when running a tool with batch processing.

2024-05-21_11h45_50

I'm not really familiar with CLI function, so I'm not sure if I can be of any help for it.

nmaarnio commented 1 week ago

Thanks for the reply, I think this already helps me! I will start with bringing the tool in QGIS so that only one layer can be used, and it can be later improved.