List of must-fix to make the otb qgis plugin usable
The purpose of this issue is to list all the issues that should be fixed in OTB or in OTB qgis plugin code so that the plugin can actually be used by Qgis users to perform tasks with Orfeo ToolBox wihout tip-toing with work-around, undocumented stuff and deep knowledge of OTB application engine insights.
The methodology I used to get this list is to try to follow plugin documentation to install the plugin on my company managed laptop, with the IT installed Qgis version (which is 3.4) and a recent windows develop (>6.2.0) binary package (when those were still existing). I then tried to perform the steps of the classification module of our training course in Qgis.
With 10 minutes of playing around, here is what I came up with:
According to documentation, I am supposed to modify the
QGIS_PLUGINPATHenvironment variable of my system, which is forbidden by my company IT policy. I created a .bat script to set this environnement variable before starting Qgis. I expect this to be pretty common on company managed gear.
In control panel of the processing toolbox in Qgis, under the OTB menu, whenever I click on the
Maximum RAM to useparameter, I have a pop-up error windows showing the message bellow. This happen several time in a raw, wherever I click. It also erases the previous value I had for this parameter and turns it into 0. If I want to use the spinbox to set this parameter without this error, I can only increment by 1 at a time (starting from 0, I would like to reach at least 256, which means as many clicks). If I type a value by hand and ignore several alike pop-up windows, it finally shows the value I set (but is it taken into account ?).
AttributeError: 'QgsSpinBox' object has no attribute 'setText' Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.6/apps/qgis/./python/plugins\processing\gui\ConfigDialog.py", line 405, in setEditorData editor.setText(value) AttributeError: 'QgsSpinBox' object has no attribute 'setText'
- First think that stroke me is that there is no layer selection for some vector data parameters. you have to browse through your file system even if you vector layer is already loaded.
- I had to put
" "around all the paths (even the ones coming from qgis file explorer) because being on windows, my file path has a lot of
[NoSave]and other stuff in it. Otherwise I get weird message when running (see below), and the application does not output anything.
2019-06-04 14:30:33 (FATAL) PolygonClassStatistics: itk::ERROR: Failed to open GDALDataset file C:\NoSave\[NoSave] : Invalid range specified
- Even when the application fails (for instance in the above case), the log tab behave as if everything went properly, with messages such as
Loading resulting layersor
- In some applications that show a list of fields in a vector file to be selected, the UI component is a blank multiline text box. One has to know the name of the field that should be used here. This may be fine for single field, but in the training app you are supposed to give the list of fields that will be used for training. This list can be big (I have maybe 70 feature fields I wan to use), and nobody is going to type those 70 fields name by hand.
- For all outputs (file, image, vector), parameters can not be deactivated, because by default qgis will try to write to a temporary file. This means that all optional outputs are always active. This is annoying, especially with the following issue.
- OTB does not recognize the file extension provided by Qgis for vector temporary output (and probably for images output as well): write to a temporary ouptut can simply not be used with those parameters
- The same management of optional parameters issue goes for input parameters (file, image, vector): even if marked optional in the UI, optional input parameters must be set.
All those issues make the most complex (and most interesting applications) of Orfeo ToolBox barely usable within Qgis. Fixing this may require to modify the plugin code, fix things in the application engine or even rework the logic of some applications, but it is mandatory for a good user experience of OTB within Qgis.