diff --git a/Documentation/Cookbook/rst/Installation.rst b/Documentation/Cookbook/rst/Installation.rst index 899c95310a97cbe6e97765bac8f15030cb17463b..4af52c934a60717494ba3bd9d2063bb8ca08492a 100644 --- a/Documentation/Cookbook/rst/Installation.rst +++ b/Documentation/Cookbook/rst/Installation.rst @@ -32,6 +32,18 @@ MacOS X .. include:: Installation_Macos.rst + +Conda package +------------- + +A conda package is available for Orfeo Toolbox on Linux. It can be found at https://anaconda.org/orfeotoolbox/otb +and can be installed with the command + +:: + + conda install -c orfeotoolbox otb + + Other packages -------------- diff --git a/Documentation/Cookbook/rst/Installation_Linux.rst b/Documentation/Cookbook/rst/Installation_Linux.rst index c1afb31371941985cc1e90283c48eb011fe08e68..b9da9e25da9ca606f43ce3d8630b0f4a29e04f17 100644 --- a/Documentation/Cookbook/rst/Installation_Linux.rst +++ b/Documentation/Cookbook/rst/Installation_Linux.rst @@ -96,6 +96,23 @@ to select their own existing Python installation rather than the one dibstribute By default, bindings for Python 3.5 will be enabled with the ``otbenv`` script. +Recompiling Python bindings ++++++++++++++++++++++++++++ + +If you are using another version of Python 3 than 3.5, but still want to use OTB Python bindings, it is possible +to compile the python bindings again with your version of Python. CMake is required (it is available in most package +managers or at [https://cmake.org/]). At the root of the OTB installation run : + +.. parsed-literal:: + + source otbenv.profile + ctest -S share/otb/swig/build_wrapping.cmake -VV + +You should now be able to import ``otbApplication`` through Python ! + +Alternatively, you could use a virtual env or otb Conda Package to use the OTB Python bindings. + + Notes: ~~~~~~ @@ -112,8 +129,8 @@ Notes: FAQ ~~~ -Q: Unable to import otbApplication library with Python3 -+++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Q: Unable to import otbApplication library with Python3.5 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ :: diff --git a/Documentation/Cookbook/rst/Installation_Macos.rst b/Documentation/Cookbook/rst/Installation_Macos.rst index d0d4480e6a90fa3868e4a64806469ea66fa8be5e..67e5e6931bc1fe126dd99b860844e1f113639bf4 100644 --- a/Documentation/Cookbook/rst/Installation_Macos.rst +++ b/Documentation/Cookbook/rst/Installation_Macos.rst @@ -44,7 +44,7 @@ supplied script ``tools/uninstall_otb.sh``. Python bindings ~~~~~~~~~~~~~~~ -Since OTB 6.7.0 OTB bindings for Python 3.5 are distributed as a binary +Since OTB 6.7.0 OTB bindings for Python 3.7 are distributed as a binary package. Please note that using a different Python version may not be compatible with OTB wrappings. If the installation completes @@ -54,7 +54,20 @@ You must have Python numpy bindings installed in your system. They can be instal without admin rights as follows: "pip install --user numpy". This is to give users the option to select their own existing Python installation rather than the one dibstributed by the OTB package. -By default, bindings for Python 3.5 will be enabled with the ``otbenv`` script. +By default, bindings for Python 3.7 will be enabled with the ``otbenv`` script. + +Recompiling Python bindings ++++++++++++++++++++++++++++ + +If you are using another version of Python 3 than 3.7, but still want to use OTB Python bindings, it is possible +to compile the python bindings again with your version of Python. CMake is required (it is available in Brew or at [https://cmake.org/]). At the root of the OTB installation run : + +.. parsed-literal:: + + source otbenv.profile + ctest -S share/otb/swig/build_wrapping.cmake -VV + +You should now be able to import ``otbApplication`` through Python ! Notes: ~~~~~~ diff --git a/Documentation/Cookbook/rst/QGISInterface.rst b/Documentation/Cookbook/rst/QGISInterface.rst index 380a7fde88f25cc17e8baaefb2df713f1318d81a..a1f838a965f3fef5b20e1b89f625b503cc6808d1 100644 --- a/Documentation/Cookbook/rst/QGISInterface.rst +++ b/Documentation/Cookbook/rst/QGISInterface.rst @@ -1,31 +1,24 @@ QGIS interface ============== -The QGIS-OTB plugin (requires QGIS > 3.2) ------------------------------------------ +The OTB QGIS plugin provides a GUI for OTB applications directly into QGIS. Note that OTB is not distributed with the plugin and needs to be installed separately. Binary packages for OTB can be found on the [download page](https://www.orfeo-toolbox.org/download). -With QGIS < 3.8 you will need to manually install the plugin. -You can follow the instruction here: https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin#otb-provider-for-qgis-processing +The plugin requires QGIS 3.2 or later, and is fully integrated within QGIS since version 3.8. +This page explains how to setup the plugin with QGIS 3.8 or later. For QGIS version between 3.2 and 3.8 the instructions on this (page)[https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin#otb-provider-for-qgis-processing] should be followed. -With QGIS > 3.8, the plugin is already in the QGIS core. So you just need to install OTB and activate the plugin: https://www.orfeo-toolbox.org/CookBook/QGISInterface.html#open-processing-settings -Download and Install OTB -^^^^^^^^^^^^^^^^^^^^^^^^ +Plugin configuration +-------------------- -OTB is not distributed with qgis-otb-plugin. It is a separate project and has its own git repository. -Download latest OTB version: https://www.orfeo-toolbox.org/download/. -Configure plugin in QGIS -^^^^^^^^^^^^^^^^^^^^^^^^ +Plugin activation +^^^^^^^^^^^^^^^^^ -Restart QGIS, then install the OTB plugin: -`Plugins -> Manage and Install Plugins`. +The plugin should be configured to find the OTB library : -Click on `Installed` tab on left and make sure box next to `OrfeoToolBox (OTB)` is checked. +Open processing settings : -Open processing settings -^^^^^^^^^^^^^^^^^^^^^^^^ `Settings -> Options -> Processing (left panel)` @@ -37,6 +30,48 @@ You can see OTB under "Providers": * Set OTB application folder. This is location of your OTB applications. ``<OTB_FOLDER>/lib/otb/applications`` * Click "ok" to save settings and close dialog. If settings are correct, you will have OTB algorithms loaded in Processing toolbox + +Documentation of OTB settings available in QGIS Processing +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* **Activate**: This is a checkbox to activate or deactivate OTB provider. Any invalid settings in OTB folder will uncheck this when saved. + +* **OTB folder**: This is the directory where OTB is available. Valid values are listed below. + +* **OTB application folder**: This is the location(s) of OTB applications. Multiple paths are allowed to use custom/proprietary OTB applications. + +* **Logger level** (optional): Level of logger to use by OTB applications. The level of logging controls the amount of details printed during algorithm execution. +Possible values for logger level are INFO, WARNING, CRITICAL, DEBUG. You can refer to otb::Logger documentation for more on this values. This value is INFO by default. This is an advanced user configuration. + +* **Maximum RAM to use** (optional): by default OTB applications use system RAM as available. You can however instruct OTB to use a specific amount of RAM from available using this option. +A value of 256 is ignored by OTB processing provider. This is an advanced user configuration. + +* **Geoid file** (optional): Path to geoid file. Value of this options is set for elev.dem.geoid and elev.geoid parameters in OTB applications. +Setting this value globally help users to share it across multiple processing algorithms. This value is empty by default. + +* **SRTM tiles folder** (optional): Directory where SRTM tiles are available. +SRTM data can be stored locally to avoid connecting to downloading of files during processing. +Value of this options is set for elev.dem.path and elev.dem parameters in OTB applications. +Setting this value globally help users to share it across multiple processing algorithms. This value is empty by default. + +Compatibility between QGIS and OTB versions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There are compatibility issues between the different versions of OTB and QGIS. In particular, OTB 7.0 +is not compatible with QGIS 3.12 and less. It will be compatible with QGIS 3.14. + +The table below summarizes which version of OTB can be used with which version of QGIS. + ++---------------+-----------------+--------------------+ +| | QGIS 3.8 - 3.12 | QGIS 3.14 and more | ++---------------+-----------------+--------------------+ +| OTB 6.6.1 | Compatible | Compatible | ++---------------+-----------------+--------------------+ +| OTB 7.0.0 | Compatible | Compatible | ++---------------+-----------------+--------------------+ +| OTB 7.1.0 | Not Compatible | Compatible | ++---------------+-----------------+--------------------+ + Troubleshoot ------------ As of QGIS 3.8 the otb plugin is in the core. It might get messy if you have a previously installed plugin. Try to remove the old plugin before launching QGIS. diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 4246be6e8f9452e820781d705bf729e29e2359f6..d77c2e5681be884c704e54ee62592960fac4e8b2 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -350,7 +350,8 @@ Application::Application() m_DocTags(), m_Doclink(""), m_IsInPrivateDo(false), - m_ExecuteDone(false) + m_ExecuteDone(false), + m_MultiWriting(false) { // Don't call Init from the constructor, since it calls a virtual method ! m_Logger->SetName("Application.logger");