diff --git a/.mailmap b/.mailmap index 40ef95e52d046d8d1917e474e2da727203f8fa46..2886fdab7698af27f0ed90fbb6a3abbadcc2c68a 100644 --- a/.mailmap +++ b/.mailmap @@ -54,7 +54,7 @@ Julien Malik <julien.malik@c-s.fr> Julien Malik <julien.m Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.michel@c-s.fr> Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.michel@orfeo-toolbox.org> -Julien Osman <julien.osman@c-s.fr> +Julien Osman <julien.osman@csgroup.eu> Julien Osman <julien.osman@c-s.fr> Laurențiu Nicola <lnicola@dend.ro> Laurentiu Nicola <lnicola@dend.ro> Laurențiu Nicola <lnicola@dend.ro> Laurențiu Nicola <grayshade@gmail.com> Luc Hermitte <luc.hermitte@c-s.fr> Luc Hermitte <luc.hermitte@cnes.fr> diff --git a/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.1.txt b/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.1.txt index a5740b7ff06d8960a97b6a796e2c0a43ce7b28dd..3ce5a16e692395a432a8785f032be1d2e727449b 100644 --- a/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.1.txt +++ b/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.1.txt @@ -1,37 +1,37 @@ ------ IMAGE -------- Spacing [1, 1] -Origin [0, 0] +Origin [0.5, 0.5] Projection REF -GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]] +GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] GCP Count 4 GCP[0] Id 1 GCP[0] Info -GCP[0] Row 1 -GCP[0] Col 1 +GCP[0] Row 0.5 +GCP[0] Col 0.5 GCP[0] X 1.05476 GCP[0] Y 43.5896 GCP[0] Z 0 ---------------- GCP[1] Id 2 GCP[1] Info -GCP[1] Row 1 -GCP[1] Col 3000 +GCP[1] Row 0.5 +GCP[1] Col 2999.5 GCP[1] X 1.41679 GCP[1] Y 43.5219 GCP[1] Z 0 ---------------- GCP[2] Id 3 GCP[2] Info -GCP[2] Row 3000 -GCP[2] Col 3000 +GCP[2] Row 2999.5 +GCP[2] Col 2999.5 GCP[2] X 1.32096 GCP[2] Y 43.313 GCP[2] Z 0 ---------------- GCP[3] Id 4 GCP[3] Info -GCP[3] Row 3000 -GCP[3] Col 1 +GCP[3] Row 2999.5 +GCP[3] Col 0.5 GCP[3] X 0.960095 GCP[3] Y 43.3803 GCP[3] Z 0 diff --git a/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.3.txt b/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.3.txt deleted file mode 100644 index 3ce5a16e692395a432a8785f032be1d2e727449b..0000000000000000000000000000000000000000 --- a/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.3.txt +++ /dev/null @@ -1,48 +0,0 @@ ------- IMAGE -------- -Spacing [1, 1] -Origin [0.5, 0.5] -Projection REF -GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] -GCP Count 4 -GCP[0] Id 1 -GCP[0] Info -GCP[0] Row 0.5 -GCP[0] Col 0.5 -GCP[0] X 1.05476 -GCP[0] Y 43.5896 -GCP[0] Z 0 ----------------- -GCP[1] Id 2 -GCP[1] Info -GCP[1] Row 0.5 -GCP[1] Col 2999.5 -GCP[1] X 1.41679 -GCP[1] Y 43.5219 -GCP[1] Z 0 ----------------- -GCP[2] Id 3 -GCP[2] Info -GCP[2] Row 2999.5 -GCP[2] Col 2999.5 -GCP[2] X 1.32096 -GCP[2] Y 43.313 -GCP[2] Z 0 ----------------- -GCP[3] Id 4 -GCP[3] Info -GCP[3] Row 2999.5 -GCP[3] Col 0.5 -GCP[3] X 0.960095 -GCP[3] Y 43.3803 -GCP[3] Z 0 ----------------- -Geo Transform -Corners - UL[0] -> 0 - UL[1] -> 0 - UR[0] -> 3000 - UR[1] -> 0 - LL[0] -> 0 - LL[1] -> 3000 - LR[0] -> 3000 - LR[1] -> 3000 diff --git a/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.txt b/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.txt index 44265a775dc58303cf8647fac1fe90f90e1bcb1a..c9ae6be41f3ac1c1321c4e51c7d7e4c7df15ad83 100644 --- a/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.txt +++ b/Data/Baseline/OTB/Files/ioOtbVectorImageTestFORMOSAT2.txt @@ -1,37 +1,37 @@ ------ IMAGE -------- Spacing [1, 1] -Origin [0, 0] +Origin [0.5, 0.5] Projection REF -GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.2572235630016,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]] +GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] GCP Count 4 GCP[0] Id 1 GCP[0] Info -GCP[0] Row 1 -GCP[0] Col 1 +GCP[0] Row 0.5 +GCP[0] Col 0.5 GCP[0] X 1.05476 GCP[0] Y 43.5896 GCP[0] Z 0 ---------------- GCP[1] Id 2 GCP[1] Info -GCP[1] Row 1 -GCP[1] Col 3000 +GCP[1] Row 0.5 +GCP[1] Col 2999.5 GCP[1] X 1.41679 GCP[1] Y 43.5219 GCP[1] Z 0 ---------------- GCP[2] Id 3 GCP[2] Info -GCP[2] Row 3000 -GCP[2] Col 3000 +GCP[2] Row 2999.5 +GCP[2] Col 2999.5 GCP[2] X 1.32096 GCP[2] Y 43.313 GCP[2] Z 0 ---------------- GCP[3] Id 4 GCP[3] Info -GCP[3] Row 3000 -GCP[3] Col 1 +GCP[3] Row 2999.5 +GCP[3] Col 0.5 GCP[3] X 0.960095 GCP[3] Y 43.3803 GCP[3] Z 0 diff --git a/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.1.txt b/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.1.txt index a46f428a25407de15197169864623fd22ce2b9d5..979813c3501f2ce23e63cf93bd0170a9d2f9a40d 100644 --- a/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.1.txt +++ b/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.1.txt @@ -1,37 +1,37 @@ ------ IMAGE -------- Spacing [1, 1] -Origin [0, 0] +Origin [0.5, 0.5] Projection REF -GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]] +GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] GCP Count 4 GCP[0] Id 1 GCP[0] Info -GCP[0] Row 1 -GCP[0] Col 1 +GCP[0] Row 0.5 +GCP[0] Col 0.5 GCP[0] X 51.1515 GCP[0] Y 36.0442 GCP[0] Z 0 ---------------- GCP[1] Id 2 GCP[1] Info -GCP[1] Row 1 -GCP[1] Col 6000 +GCP[1] Row 0.5 +GCP[1] Col 5999.5 GCP[1] X 51.8029 GCP[1] Y 35.9172 GCP[1] Z 0 ---------------- GCP[2] Id 3 GCP[2] Info -GCP[2] Row 6000 -GCP[2] Col 6000 +GCP[2] Row 5999.5 +GCP[2] Col 5999.5 GCP[2] X 51.6467 GCP[2] Y 35.3907 GCP[2] Z 0 ---------------- GCP[3] Id 4 GCP[3] Info -GCP[3] Row 6000 -GCP[3] Col 1 +GCP[3] Row 5999.5 +GCP[3] Col 0.5 GCP[3] X 50.9995 GCP[3] Y 35.5173 GCP[3] Z 0 @@ -46,3 +46,4 @@ Corners LL[1] -> 6000 LR[0] -> 6000 LR[1] -> 6000 + diff --git a/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.3.txt b/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.3.txt deleted file mode 100644 index 465456d6c79942c8abc8e1c8883df49e6df0139e..0000000000000000000000000000000000000000 --- a/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.3.txt +++ /dev/null @@ -1,48 +0,0 @@ ------- IMAGE -------- -Spacing [1, 1] -Origin [0.5, 0.5] -Projection REF -GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] -GCP Count 4 -GCP[0] Id 1 -GCP[0] Info -GCP[0] Row 0.5 -GCP[0] Col 0.5 -GCP[0] X 51.1515 -GCP[0] Y 36.0442 -GCP[0] Z 0 ----------------- -GCP[1] Id 2 -GCP[1] Info -GCP[1] Row 0.5 -GCP[1] Col 5999.5 -GCP[1] X 51.8029 -GCP[1] Y 35.9172 -GCP[1] Z 0 ----------------- -GCP[2] Id 3 -GCP[2] Info -GCP[2] Row 5999.5 -GCP[2] Col 5999.5 -GCP[2] X 51.6467 -GCP[2] Y 35.3907 -GCP[2] Z 0 ----------------- -GCP[3] Id 4 -GCP[3] Info -GCP[3] Row 5999.5 -GCP[3] Col 0.5 -GCP[3] X 50.9995 -GCP[3] Y 35.5173 -GCP[3] Z 0 ----------------- -Geo Transform -Corners - UL[0] -> 0 - UL[1] -> 0 - UR[0] -> 6000 - UR[1] -> 0 - LL[0] -> 0 - LL[1] -> 6000 - LR[0] -> 6000 - LR[1] -> 6000 diff --git a/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.txt b/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.txt index 98347deea9cff0872e2929fb0286bad538898736..8173678535f22c0749bbf61bbf61239de16bd1f7 100644 --- a/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.txt +++ b/Data/Baseline/OTB/Files/ioOtbVectorImageTestSpot5.txt @@ -1,37 +1,37 @@ ------ IMAGE -------- Spacing [1, 1] -Origin [0, 0] +Origin [0.5, 0.5] Projection REF -GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.2572235629972,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]] +GCP Projection GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] GCP Count 4 GCP[0] Id 1 GCP[0] Info -GCP[0] Row 1 -GCP[0] Col 1 +GCP[0] Row 0.5 +GCP[0] Col 0.5 GCP[0] X 51.1515 GCP[0] Y 36.0442 GCP[0] Z 0 ---------------- GCP[1] Id 2 GCP[1] Info -GCP[1] Row 1 -GCP[1] Col 6000 +GCP[1] Row 0.5 +GCP[1] Col 5999.5 GCP[1] X 51.8029 GCP[1] Y 35.9172 GCP[1] Z 0 ---------------- GCP[2] Id 3 GCP[2] Info -GCP[2] Row 6000 -GCP[2] Col 6000 +GCP[2] Row 5999.5 +GCP[2] Col 5999.5 GCP[2] X 51.6467 GCP[2] Y 35.3907 GCP[2] Z 0 ---------------- GCP[3] Id 4 GCP[3] Info -GCP[3] Row 6000 -GCP[3] Col 1 +GCP[3] Row 5999.5 +GCP[3] Col 0.5 GCP[3] X 50.9995 GCP[3] Y 35.5173 GCP[3] Z 0 diff --git a/Data/Baseline/OTB/Images/apTvPrSuperimposePHR_nn.tif b/Data/Baseline/OTB/Images/apTvPrSuperimposePHR_nn.tif new file mode 100644 index 0000000000000000000000000000000000000000..20bd7b1d3d4384fd32d7ead7085a7ab3b06495f5 --- /dev/null +++ b/Data/Baseline/OTB/Images/apTvPrSuperimposePHR_nn.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6b8f0cc600d2b17c28cc7a3e7a2348bd986ed600f9ee86a3b96d7a83c75a88f +size 8010952 diff --git a/Documentation/Cookbook/rst/CompilingOTBFromSource.rst b/Documentation/Cookbook/rst/CompilingOTBFromSource.rst index 06752cb8d4cd1dd918f57dc8cf43f087c57c2b0b..197525ff63f7bf0d37afbc57e6cee5a5d91ed65c 100644 --- a/Documentation/Cookbook/rst/CompilingOTBFromSource.rst +++ b/Documentation/Cookbook/rst/CompilingOTBFromSource.rst @@ -29,7 +29,7 @@ process: +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ | `ITK <http://www.itk.org>`_ | Yes | 4.6.0 | 4.13.1 | +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ - | `GDAL <http://www.gdal.org>`_ | Yes | 2.0 | 2.4.1 | + | `GDAL <http://www.gdal.org>`_ | Yes | 2.4.1 | 3.1.0 | +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ | `OSSIM <http://www.ossim.org>`_ | Yes | 1.8.20-3 | 1.8.20 | +------------------------------------------------------------------+-----------------------+----------------------------+--------------------------+ 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..b2fa2a210feb69a2bb04037921713c78461ab299 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,49 @@ 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. Any version +of OTB compiled with GDAL 3.X is not compatible with QGIS 3.12 or below. This is the case +for the binary packages of OTB 7.1 and above. In this case QGIS 3.14 or more should be used. + +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/Applications/AppProjection/app/otbSuperimpose.cxx b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx index 2edfa2aeebed4686778d848c9babc10dc54808f3..469fd1a1f6cd34d1ffa19246c90c96bc93a843da 100644 --- a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx +++ b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx @@ -192,6 +192,7 @@ private: NNInterpolatorType::Pointer interpolator = NNInterpolatorType::New(); m_Resampler->SetInterpolator(interpolator); m_BasicResampler->SetInterpolator(interpolator); + m_BasicResampler->SetInterpolationMargin(1e-9); } break; case Interpolator_BCO: diff --git a/Modules/Applications/AppProjection/test/CMakeLists.txt b/Modules/Applications/AppProjection/test/CMakeLists.txt index 4637dacd5fe6782a70f27d9bf5f8515d841ef704..02265a85e582093faf57841dd98b1fd08285d4ee 100644 --- a/Modules/Applications/AppProjection/test/CMakeLists.txt +++ b/Modules/Applications/AppProjection/test/CMakeLists.txt @@ -367,3 +367,13 @@ otb_test_application(NAME apTvPrSuperimpose_phr VALID --compare-image ${EPSILON_7} ${BASELINE}/apTvPrSuperimposePHR.tif ${TEMP}/apTvPrSuperimposePHR.tif) + +otb_test_application(NAME apTvPrSuperimpose_phr_nn + APP Superimpose + OPTIONS -inr ${INPUTDATA}/phr_pan.tif + -inm ${INPUTDATA}/phr_xs.tif + -interpolator nn + -out ${TEMP}/apTvPrSuperimposePHR_nn.tif int16 + VALID --compare-image ${EPSILON_7} + ${BASELINE}/apTvPrSuperimposePHR_nn.tif + ${TEMP}/apTvPrSuperimposePHR_nn.tif) diff --git a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.h index a45a37c15de6b83f7d9ae41e69fb4787acd73c6d..be41f30243107f415d71812c7b472fc5ee0cb01e 100644 --- a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.h @@ -124,6 +124,9 @@ public: itkGetMacro(CheckOutputBounds, bool); itkBooleanMacro(CheckOutputBounds); + itkSetMacro(InterpolationMargin, double); + itkGetMacro(InterpolationMargin, double); + itkSetObjectMacro(Interpolator, InterpolatorType); itkGetObjectMacro(Interpolator, InterpolatorType); @@ -190,6 +193,8 @@ private: OutputPixelType m_EdgePaddingValue; // Default pixel value + double m_InterpolationMargin; + bool m_CheckOutputBounds; // Shall we check // output bounds when // casting? diff --git a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx index 34ecb1be90d6cf689907d1dc73acc68b2b8838a4..7097361de8252f0e1baee2896ac051baf1648efa 100644 --- a/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx +++ b/Modules/Filtering/ImageManipulation/include/otbGridResampleImageFilter.hxx @@ -42,6 +42,7 @@ GridResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision>::Grid m_OutputSpacing(), m_EdgePaddingValue(), m_CheckOutputBounds(true), + m_InterpolationMargin(0.0), m_Interpolator(), m_ReachableOutputRegion() { @@ -227,7 +228,6 @@ void GridResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision>: // Compute the padding due to the interpolator - IndexType inUL = this->GetInput()->GetBufferedRegion().GetIndex(); IndexType inLR = this->GetInput()->GetBufferedRegion().GetIndex() + this->GetInput()->GetBufferedRegion().GetSize(); inLR[0] -= 1; @@ -246,9 +246,9 @@ void GridResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision>: this->GetInput()->TransformIndexToPhysicalPoint(inUL, inULp); this->GetInput()->TransformIndexToPhysicalPoint(inLR, inLRp); - inULp -= 0.5 * this->GetInput()->GetSignedSpacing(); - inLRp += 0.5 * this->GetInput()->GetSignedSpacing(); - + inULp -= (0.5 - m_InterpolationMargin) * this->GetInput()->GetSignedSpacing(); + inLRp += (0.5 - m_InterpolationMargin) * this->GetInput()->GetSignedSpacing(); + ContinuousInputIndexType outUL; ContinuousInputIndexType outLR; this->GetOutput()->TransformPhysicalPointToContinuousIndex(inULp, outUL); @@ -265,6 +265,8 @@ void GridResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision>: m_ReachableOutputRegion.SetIndex(outputIndex); m_ReachableOutputRegion.SetSize(outputSize); + + otbMsgDevMacro(<< "ReachableOutputRegion: " << m_ReachableOutputRegion); } template <typename TInputImage, typename TOutputImage, typename TInterpolatorPrecision> diff --git a/Modules/Learning/Sampling/include/otbImageSampleExtractorFilter.hxx b/Modules/Learning/Sampling/include/otbImageSampleExtractorFilter.hxx index b80fcab64de6398d64d3025028fce9d563b27c69..2a104da37f348713ff62b65d564c2b3a0481dc50 100644 --- a/Modules/Learning/Sampling/include/otbImageSampleExtractorFilter.hxx +++ b/Modules/Learning/Sampling/include/otbImageSampleExtractorFilter.hxx @@ -117,6 +117,9 @@ void PersistentImageSampleExtractorFilter<TInputImage>::GenerateOutputInformatio #if GDAL_VERSION_NUM >= 3000000 // importFromWkt is const-correct in GDAL 3 const char* projWktCstr = projectionRefWkt.c_str(); OGRErr err = imgSRS.importFromWkt(&projWktCstr); + // Use the same mapping strategy as the one in the datasource. + imgSRS.SetAxisMappingStrategy( + this->GetOGRData()->GetLayer(this->GetLayerIndex()).GetSpatialRef()->GetAxisMappingStrategy ()); #else const char* projWktCstr = projectionRefWkt.c_str(); char** projWktPointer = const_cast<char**>(&projWktCstr); diff --git a/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.hxx b/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.hxx index d05530ddab3e45a41bae22a9356c2a24bc996ff4..d623a110075e3b9aa2e122ede181a02409fe9cdf 100644 --- a/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.hxx +++ b/Modules/Segmentation/Conversion/include/otbPersistentImageToOGRLayerFilter.hxx @@ -89,6 +89,14 @@ void PersistentImageToOGRLayerFilter<TImage>::Initialize() oSRSESRI.morphToESRI(); oSRSESRI.morphFromESRI(); + +#if GDAL_VERSION_NUM >= 3000000 // importFromWkt is const-correct in GDAL 3 + // Use the same mapping strategy as the one in the datasource. + auto mappingStrategy = m_OGRLayer.GetSpatialRef()->GetAxisMappingStrategy(); + oSRS.SetAxisMappingStrategy(mappingStrategy); + oSRSESRI.SetAxisMappingStrategy(mappingStrategy); +#endif + if (m_OGRLayer.GetSpatialRef() && (!oSRS.IsSame(m_OGRLayer.GetSpatialRef()) && !oSRSESRI.IsSame(m_OGRLayer.GetSpatialRef()))) { if ((oSRS.Validate() != OGRERR_NONE) && (oSRSESRI.Validate() != OGRERR_NONE)) 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"); diff --git a/Packaging/PackageGlobals.cmake b/Packaging/PackageGlobals.cmake index 9db929f030f011ecc673a2799e15c3f06acee016..4fef622a6f887099c2d421087c95b77f9f405d29 100644 --- a/Packaging/PackageGlobals.cmake +++ b/Packaging/PackageGlobals.cmake @@ -94,6 +94,7 @@ set(LINUX_SYSTEM_DLLS libidn.so libgomp.so* ld-linux-x86-64.so* + libgssapi_krb5.so* libX11.so* libXi.so* #GLUT libXcursor.so* #GLFW diff --git a/SuperBuild/CMake/External_gdal.cmake b/SuperBuild/CMake/External_gdal.cmake index ad47a8f3c48fa126860be8efbd0b38e4a7ac8b99..d099e1d63d94388cc8477714f564e2fa32e0c3b0 100644 --- a/SuperBuild/CMake/External_gdal.cmake +++ b/SuperBuild/CMake/External_gdal.cmake @@ -148,8 +148,8 @@ endif() ExternalProject_Add(GDAL PREFIX GDAL - URL "http://download.osgeo.org/gdal/3.0.2/gdal-3.0.2.tar.gz" - URL_MD5 8a31507806b26f070858558aaad42277 + URL "http://download.osgeo.org/gdal/3.1.0/gdal-3.1.0.tar.gz" + URL_MD5 bda0f002cd63b51c8d2f1b1400daffa9 SOURCE_DIR ${GDAL_SB_SRC} BINARY_DIR ${GDAL_SB_SRC} INSTALL_DIR ${SB_INSTALL_PREFIX} diff --git a/SuperBuild/patches/GDAL/gdal-3-ioheaderconflict-win.diff b/SuperBuild/patches/GDAL/gdal-3-ioheaderconflict-win.diff new file mode 100644 index 0000000000000000000000000000000000000000..bd2eaf25468fe5705c9f83ab9ffc774896ea9f47 --- /dev/null +++ b/SuperBuild/patches/GDAL/gdal-3-ioheaderconflict-win.diff @@ -0,0 +1,28 @@ +diff -burN gdal_orig/apps/gdaltransform.cpp gdal/apps/gdaltransform.cpp +--- gdal_orig/apps/gdaltransform.cpp 2020-05-28 13:20:16.124465749 +0200 ++++ gdal/apps/gdaltransform.cpp 2020-05-28 13:26:47.563450287 +0200 +@@ -47,7 +47,9 @@ + #include "commonutils.h" + + #ifdef _WIN32 +-#include <io.h> ++// We need the io.h file from system but io.h from geos conflicts with io.h from system ++//#include <io.h> ++#include <corecrt_io.h> + #else + #include <unistd.h> + #endif +diff -burN gdal_orig/apps/gdallocationinfo.cpp gdal/apps/gdallocationinfo.cpp +--- gdal_orig/apps/gdallocationinfo.cpp 2020-05-28 13:20:16.124465749 +0200 ++++ gdal/apps/gdallocationinfo.cpp 2020-05-28 13:26:58.719601480 +0200 +@@ -36,7 +36,9 @@ + #include <vector> + + #ifdef _WIN32 +-#include <io.h> ++// We need the io.h file from system but io.h from geos conflicts with io.h from system ++//#include <io.h> ++#include <corecrt_io.h> + #else + #include <unistd.h> + #endif diff --git a/SuperBuild/patches/GDAL/gdal-4-fixhdf5-win.diff b/SuperBuild/patches/GDAL/gdal-4-fixhdf5-win.diff deleted file mode 100644 index ecdff5829509a786ea54a8c9cbec034586c3c19b..0000000000000000000000000000000000000000 --- a/SuperBuild/patches/GDAL/gdal-4-fixhdf5-win.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- gdal-2.4.1_orig/frmts/hdf5/makefile.vc 2019-03-15 13:30:02.000000000 +0100 -+++ gdal-2.4.1/frmts/hdf5/makefile.vc 2019-04-05 17:43:22.356322797 +0200 -@@ -7,7 +7,7 @@ - - PLUGIN_DLL = gdal_HDF5.dll - --EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -D_HDF5USEDLL_ -+EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -DH5_BUILT_AS_DYNAMIC_LIB - - !IF "$(HDF5_PLUGIN)" == "YES" - EXTRAFLAGS = $(EXTRAFLAGS) -DHDF5_PLUGIN diff --git a/SuperBuild/patches/GDAL/nmake_gdal_extra.opt.in b/SuperBuild/patches/GDAL/nmake_gdal_extra.opt.in index 2276389caf9d30b3d63807f356ddbf2462147cb0..15ed78cc162e8bef10b42b97e54f50ff9a513273 100644 --- a/SuperBuild/patches/GDAL/nmake_gdal_extra.opt.in +++ b/SuperBuild/patches/GDAL/nmake_gdal_extra.opt.in @@ -109,6 +109,10 @@ NETCDF_INC_DIR = @SB_INSTALL_PREFIX_NATIVE@\include NETCDF_HAS_NC4 = YES NETCDF_HAS_HDF4 = YES +# Needed to define H5_BUILT_AS_DYNAMIC_LIB for windows compilation +# scenarios where it is not exported on the target (non-CMake builds) +HDF5_H5_IS_DLL = YES + # Binding list. One or several in the following list # csharp, java, python BINDINGS=python