BUG: disable non relevant output parameters in zonal statistics depending on the output type chosen

Merged Cédric Traizet requested to merge fix_zonalstatistics into release-7.0

This MR is a fix for this bug reported on the forum.

Rationale

In ZonalStatistics the output mode can be chosen between raster or vector (or xml but this is not relevant here), but if a mode is chosen and if the outparameter filename for the other mode has been set (it happens in Monteverdi because of the default values given by the software), for example if the mode is vector and out.raster.filename has been set, the application engine will try to create the wrong output (in addition to the right output), leading to a crash (see the forum for an example).

Implementation Details

This fix simply disable the incorrect parameters after the parsing of the choice.

Additional notes

The bug actually comes from the application engine, and this is a fix in the ZonalStatistics application, we should try to fix the bug in the application engine. This requires some refactoring and I don't want to do it in the relase branch.

A similar fix is already implemented in the Segmentation application.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit

Merge request reports