Skip to content

ENH: Improve QGIS interface for ExtractROI application

Julien Cabieces requested to merge troopa81/otb:fix_extractroi into develop

Summary

This Merge request proposes to fix/improve some issues in QGIS ExtractROI parameters selection IHM.

Rationale

Hi,

I'm Julien Cabieces and I work for Oslandia on behalf of CNES and I'm a regular QGIS contributor (@troopa81 on GitHub). I will contribute occasionally to OTB in order to improve OTB interface in QGIS.

I'll do my best to to contribute as expected in contribution guidelines. still, if I miss something please let me know.

This first PR is about fixing ExtractRoi application. When user try to use this application from QGIS, he faces two issues:

  • 1. When you select an other mode than standard one, you still have the standard parameters (Start X, Start Y, Size X, Size Y)

  • 2. On fit mode, you have to select both a vector and a raster when only one should be needed

Implementation Details

  • 1. The issue is due to the fact that these parameters switch from Input_Role in standard mode to Output_Role in the other modes (in order to print the computed extent), but QGIS is not aware of this. I propose to add specific parameter for standard, and keep the actual ones as always output. One drawback of this is that the parameter are repeated in standard mode in Monteverdi.

extractroi

Another drawback is if some people use it from the command line, they'd have to change startx parameters to mode.standard.x (same for starty, sizex, sizey). I'm not sure if this is considered as an API break and should be documented/advertised somewhere.

  • 2. Both reference vector and reference image fields are Mandatory and their state switch in DoUpParameters. I propose to set them as not mandatory in DoInit and update their state in DoUpdateParameters.

Additional notes

Copyright

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

cc @ytanguy @esarrazin


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
Edited by Julien Cabieces

Merge request reports