otb issueshttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues2020-08-27T17:50:14Zhttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2076Develop package names2020-08-27T17:50:14ZCédric TraizetDevelop package namesPackages for the develop branch of otb are available [here](https://www.orfeo-toolbox.org/packages/ci/latest/). However the packages have the same names as the packages of the last release, for example `OTB-7.1.0-Linux64.run`. It would b...Packages for the develop branch of otb are available [here](https://www.orfeo-toolbox.org/packages/ci/latest/). However the packages have the same names as the packages of the last release, for example `OTB-7.1.0-Linux64.run`. It would be better to have a name corresponding to the corresponding commit in otb repo.
@msavinaud suggested using `git describe` to generate the name of the package. This command return the last version tag, the number of commits since last version and the commit hash, for example with the last version of develop it returns :
```
7.1.0-144-g48c6e94
```
The name of the package would then be
```
OTB-7.1.0-144-g48c6e94-Linux64.run
```
This also applies to the Documentation and source tarballs.https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2052Support for GDAL 3.12020-07-17T08:17:48ZCédric TraizetSupport for GDAL 3.1GDAL 3.1 is available ! See the related [osgeo post](https://www.osgeo.org/foundation-news/gdal-3-1-0-is-released/)
We should :
* Test OTB compatibility with this release, and modify the library accordingly.
* Upgrade gdal version in S...GDAL 3.1 is available ! See the related [osgeo post](https://www.osgeo.org/foundation-news/gdal-3-1-0-is-released/)
We should :
* Test OTB compatibility with this release, and modify the library accordingly.
* Upgrade gdal version in Superbuild to 3.1 ?7.2.0Cédric TraizetCédric Traizethttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2086Update the documentation about Remote Modules2021-02-09T20:22:14ZJulien OsmanUpdate the documentation about Remote Modules### Target documentation resources
Documentation about the Remote Modules can be found in many places :
- https://www.orfeo-toolbox.org/CookBook/C++/AddingNewModules.html
- https://wiki.orfeo-toolbox.org/index.php/Remote_Modules
- http...### Target documentation resources
Documentation about the Remote Modules can be found in many places :
- https://www.orfeo-toolbox.org/CookBook/C++/AddingNewModules.html
- https://wiki.orfeo-toolbox.org/index.php/Remote_Modules
- https://wiki.orfeo-toolbox.org/index.php/How_to_write_a_remote_module
- https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Remote-Modules
- https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/CONTRIBUTING.md#remote-modules
### Change requested
It would be better to have the documentation about the Remote Modules in one place, well organized, and up to date. I think the CookBook is the best place for this documentation. Other resources should then link to the CookBook page. A table of content could be:
1. Introduction (what are remote modules)
1. Installation of remotes modules (for users who want to use a remote module)
1. Writing a remote module (for user who want to write a remote module)
1. The steps to make a remote module
1. Making it official (what to do to add the remote module to https://gitlab.orfeo-toolbox.org/remote_modules)Thibaut ROMAINThibaut ROMAINhttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1954Support of OpenCV versions in OTB (v2, v3 and v4)2019-11-04T16:34:08ZCédric TraizetSupport of OpenCV versions in OTB (v2, v3 and v4)As of today, both OpenCV 2 and OpenCV 3 are supported in otb. The whole `ml` module is different in the two version, which is the module used in otb (in addition to the `core` module). In practice for each classifier two versions of the ...As of today, both OpenCV 2 and OpenCV 3 are supported in otb. The whole `ml` module is different in the two version, which is the module used in otb (in addition to the `core` module). In practice for each classifier two versions of the code is implemented, one for OpenCV 2 and one for OpenCV 3. This makes the code hard to maintain, and hard to test (a lot of tests need to have one baseline for each version).
As OpenCV2 has been around for some time, I think we can drop the support for OpenCV2
Also, OpenCV 4 has been releases (last version is OpenCV 4.1.1). For now, OTB doesn't compile with v4.1.1, but I don't this it should be hard to make it compatible, as there is no major API change (the main change is the switch to c++ 11).https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1815ExtractROI 'mode fit' generates wrong clip when the reference extent exceeds ...2019-05-28T09:29:50ZSébastien PeilletExtractROI 'mode fit' generates wrong clip when the reference extent exceeds the input raster extent### Description
ExtractROI application generates wrong clip in fit mode (vect or im reference) when the reference exceeds input raster extent.
It's due to the conversion of physical point to index point. Point that is outside input ras...### Description
ExtractROI application generates wrong clip in fit mode (vect or im reference) when the reference exceeds input raster extent.
It's due to the conversion of physical point to index point. Point that is outside input raster extent can be converted into negative index value (cf. [otbExtractROI.cxx](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/blob/develop/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx#L770) )
| before ExtractRoi | after ExtractRoi | corrected ExtractRoi |
| ------ | ------ | ------ |
| <img src="http://open.geoexmachina.fr/img/article/before.png" width="200"/> | <img src="http://open.geoexmachina.fr/img/article/after.png" width="200" /> | <img src="http://open.geoexmachina.fr/img/article/correction.png" width="200"/> |
I fixed the problem by replacing negative index with 0 (cf. [fix](https://gitlab.orfeo-toolbox.org/SebastienPeillet/otb/commit/c9acde4464af34c9ff0e66b60d1e230da2a261a0) )
### Steps to reproduce
create a vector layer that exceeds your raster
use cmd:
> otbcli_ExtractROI -in input.tif -mode fit -mode.fit.vect vect.shp -out output.tif
### Configuration information
Ubuntu 16.04, OTB 6.6.1, build with [iota2](https://framagit.org/inglada/iota2) method7.0.0https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2071build otb conda package2020-08-28T17:50:09ZArthur Vincentbuild otb conda package### Description
I was trying to compile otb in a conda environment until an error occur during the configure step:
```bash
Enabled OTBTransform, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBUnmixing, requested by OTB_BUILD_DE...### Description
I was trying to compile otb in a conda environment until an error occur during the configure step:
```bash
Enabled OTBTransform, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBUnmixing, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBUnsupervised, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBVectorDataBase, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBVectorDataIO, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBVectorDataManipulation, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBWatersheds, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBWavelet, requested by OTB_BUILD_DEFAULT_MODULES.
-- Enabled OTBlibkml, requested by OTB_BUILD_DEFAULT_MODULES.
-- Using GSL. Your OTB will be under the GNU GPL License or better.
-- Using OTBTemporalGapFilling. Your OTB will be under the Affero GNU GPL License or better.
-- Using iota2. Your OTB will be under the GNU GPL License.
CMake Error at CMake/FindMuParser.cmake:54 (math):
math cannot parse the expression: "((/*
_____ __ _____________ _______ ______ ___________
/ \| | \____ \__ \\_ __ \/ ___// __ \_ __ \
| Y Y \ | / |_> > __ \| | \/\___ \\ ___/| | \/
|__|_| /____/| __(____ /__| /____ >\___ >__|
\/ |__| \/ \/ \/
Copyright (C) 2004 - 2020 Ingo Berg
...
...
CMake 3.17.0 successfully configured OTB using Ninja generator
======================= End of OTB cmake summary =======================
-- Configuring incomplete, errors occurred!
```
also, the following is present in my CMakeError.log file :
```bash
Source file was:
int main() { return 0;}
Performing C++ SOURCE FILE Test CXX_HAS_DISABLE_OPTIMIZATION_FLAG failed with the following output:
Change Dir: /mnt/data/home/tardyb/miniconda3/conda-bld/otb_1592396585387/work/build/CMakeFiles/CMakeTmp
Run Build Command(s):/mnt/data/home/tardyb/miniconda3/conda-bld/otb_1592396585387/_build_env/bin/ninja cmTC_6efe8 && [1/2] Building CXX object CMakeFiles/cmTC_6efe8.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_6efe8.dir/src.cxx.o
/mnt/data/home/tardyb/miniconda3/conda-bld/otb_1592396585387/_build_env/bin/x86_64-conda_cos6-linux-gnu-g++ -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel -std=c++14 -DCXX_HAS_DISABLE_OPTIMIZATION_FLAG -std=c++14 -o CMakeFiles/cmTC_6efe8.dir/src.cxx.o -c src.cxx
src.cxx:1:1: error: expected unqualified-id before '-' token
-O0
^
ninja: build stopped: subcommand failed.
Source file was:
-O0
```
thanks to @gpasero advices I temporary fix these issues thanks to some corrections, here is the the diff
about FindMuParser.cmake
```bash
diff --git OTB/CMake/FindMuParser.cmake OTB/CMake/FindMuParser.cmake
index ecfd7e7..68cf1af 100644
--- OTB/CMake/FindMuParser.cmake
+++ OTB/CMake/FindMuParser.cmake
@@ -39,7 +39,8 @@ endif()
find_path( MUPARSER_INCLUDE_DIR muParser.h
PATH_SUFFIXES muParser )
-if(EXISTS "${MUPARSER_INCLUDE_DIR}/muParserDef.h")
+# if(EXISTS "${MUPARSER_INCLUDE_DIR}/muParserDef.h")
+if(0)
file(READ "${MUPARSER_INCLUDE_DIR}/muParserDef.h" _muParserDef_h_CONTENTS)
string(REGEX REPLACE ".*# *define MUP_VERSION *_T\\(\"([0-9.]+)\"\\).*" "\\1" MUPARSER_VERSION "${_muP
if(MUPARSER_VERSION MATCHES "^[0-9]+\$")
```
and on OTBSetStandardCompilerFlags.cmake
```bash
diff --git OTB/CMake/OTBSetStandardCompilerFlags.cmake OTB/CMake/OTBSetStandardCompilerFlags.cmake
index a9f4e19..156e9ba 100644
--- OTB/CMake/OTBSetStandardCompilerFlags.cmake
+++ OTB/CMake/OTBSetStandardCompilerFlags.cmake
@@ -333,7 +333,7 @@ macro(check_compiler_platform_flags)
set(OTB_CXX_DISABLE_OPTIMIZATION_FLAG "-O0")
endif()
if(DEFINED OTB_CXX_DISABLE_OPTIMIZATION_FLAG)
- CHECK_CXX_SOURCE_COMPILES(${OTB_CXX_DISABLE_OPTIMIZATION_FLAG} CXX_HAS_DISABLE_OPTIMIZATION_FLAG)
+ CHECK_CXX_COMPILER_FLAG(${OTB_CXX_DISABLE_OPTIMIZATION_FLAG} CXX_HAS_DISABLE_OPTIMIZATION_FLAG)
endif()
endmacro()#End the platform check function
```
I'm using muparser 2.3.2 from conda-forge, this muparser version seems to be unrecognizable.Cédric TraizetCédric Traizethttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1999owTvQtWidgetShow test failing (randomly ?)2020-03-12T09:10:30ZCédric TraizetowTvQtWidgetShow test failing (randomly ?)This [job](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/jobs/16317) (CentOS build stage) of merge request !641 failed because the following test failed : owTvQtWidgetShow.
This is not related to the modification of the Merge requ...This [job](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/jobs/16317) (CentOS build stage) of merge request !641 failed because the following test failed : owTvQtWidgetShow.
This is not related to the modification of the Merge request, and the job was successful after re-executing it manually.
I don't know why this job failed. Has someone ever experienced this ? If it happens again we should investigate.https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1987OTB QGIS plug in does not appear in QGIS 3.102019-11-20T14:22:42ZkevinxbrownOTB QGIS plug in does not appear in QGIS 3.10Have followed instructions here: https://www.orfeo-toolbox.org/CookBook/QGISInterface.html
..to install OTB plugin on QGIS 3.10 on mac.
But the plugin does not appear. I have tried adding the CNES repo manually, but cannot find the OTB ...Have followed instructions here: https://www.orfeo-toolbox.org/CookBook/QGISInterface.html
..to install OTB plugin on QGIS 3.10 on mac.
But the plugin does not appear. I have tried adding the CNES repo manually, but cannot find the OTB plug in anywhere. Is it supported on QGIS 3.10 please?https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1964stop in cmake configure if we knew it can't be compiled2019-10-22T06:36:26ZRashad Kanavathstop in cmake configure if we knew it can't be compiled### Description
OTB and SuperBuild continues to build with an unsupported gcc/clang compiler and crash later.
There is a "[cmake warning](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/blob/develop/CMakeLists.txt#L44)" printed on co...### Description
OTB and SuperBuild continues to build with an unsupported gcc/clang compiler and crash later.
There is a "[cmake warning](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/blob/develop/CMakeLists.txt#L44)" printed on console but ain't right.
This Must be changed to "FATAL_ERROR" rather than "STATUS" ? The current code is simply wasting my screen real estate!
Also same thing in case of SuperBuild cmake configure (unsupported compiler should be out).
And..
If there is a special case where message type cannot be changed to FATAL_ERROR, that is debatable
### Steps to reproduce
Install centos7 on empty partition
Boot into and build OTB with default gcc
### Configuration information
LinuxCédric TraizetCédric Traizethttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1952Crash with the decision tree classifier in OpenCV 3.4.1 and K-fold cross-vali...2019-08-09T12:15:13ZCédric TraizetCrash with the decision tree classifier in OpenCV 3.4.1 and K-fold cross-validations > 1### Description
when training a decision tree classifier in OpenCV 3.4.1 and K-fold cross-validations > 1 (`classifier.dt.f > 1`), the application crash with the error message
```
2019-08-01 10:24:30 (FATAL) TrainVectorClassifier: Cau...### Description
when training a decision tree classifier in OpenCV 3.4.1 and K-fold cross-validations > 1 (`classifier.dt.f > 1`), the application crash with the error message
```
2019-08-01 10:24:30 (FATAL) TrainVectorClassifier: Caught std::exception during application execution: OpenCV(3.4.1) /Datas/Code/OTB/SuperBuild/OPENCV/build/modules/ml/precomp.hpp:157: error: (-213) tree pruning using cross-validation is not implemented.Set CVFolds to 1 in function setCVFolds
```
Apparently, this bug is already known and "fixed" when defining the `classifier.dt.f` parameter in `otbTrainDecisionTree.hxx:78`
``` cpp
//CVFolds
AddParameter(ParameterType_Int, "classifier.dt.f", "K-fold cross-validations");
#ifdef OTB_OPENCV_3
// disable cross validation by default (crash in opencv 3.2)
SetParameterInt("classifier.dt.f",0);
#else
SetParameterInt("classifier.dt.f",10);
#endif
SetParameterDescription("classifier.dt.f",
"If cv_folds > 1, then it prunes a tree with K-fold cross-validation where K "
"is equal to cv_folds.");
```
The default value of the parameter has been set to 0, so it doesn't crash if the parameter is not set, but maybe we should just remove the parameter when using open cv3 if it makes the application crash.
### Configuration information
Superbuild (opencv 3.4.1)7.0.0https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1946Deploy job and CookBook2020-02-07T16:11:00ZAntoine RegimbeauDeploy job and CookBookAs of today the deploy job is updating the cookbook to the server as an archive. It needs to untar it so that we can update the link https://www.orfeo-toolbox.org/CookBook-develop to the latest version.As of today the deploy job is updating the cookbook to the server as an archive. It needs to untar it so that we can update the link https://www.orfeo-toolbox.org/CookBook-develop to the latest version.7.0.0https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1933Prepare shark 4.x situation for 7.0 release2019-08-06T14:40:30ZVictor PoughonPrepare shark 4.x situation for 7.0 release* Check shark 4.x availability in debian* Check shark 4.x availability in debian7.0.0Guillaume PaseroGuillaume Paserohttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1916type assertion in OGRFieldWrapper GetValue()2019-07-08T07:56:52ZCédric Traizettype assertion in OGRFieldWrapper GetValue()The `GetValue<T>()` method of `otbOGRFieldWrapper` returns the value of the field by calling the ogr method associated with type T, for example, if T=int, it will call `ogr::GetFieldAsInteger`.
There is an assertion that compares the ...The `GetValue<T>()` method of `otbOGRFieldWrapper` returns the value of the field by calling the ogr method associated with type T, for example, if T=int, it will call `ogr::GetFieldAsInteger`.
There is an assertion that compares the type of the field object from wchich the method is called to the required type (l454 of otbOGRFieldWrapper.hxx):
``` cpp
assert(m_Definition.GetType() == Kind::value && "OGR field type mismatches the type of requested field value");
```
This means that, if otb is compiled with assertion, `GetValue<int>()` can only be called on integer fields, `GetValue<string>()` can only be called on string fields and so on.
The `GetValue<T>()` method of otbOGRFieldWrapper returns the value of the field by calling the ogr method associated with type T, for example, if T=int, it will call ogr::GetFieldAsInteger.
There is an assertion that compares the type of the field object from wchich the method is called to the required type (l454 of otbOGRFieldWrapper.hxx):
I don't think this is the expected behavior of such a function, as ogr's GetFieldAsXXX can do conversions, for example calling `atoi` to convert string to int if GetFieldAsInt is called on a string field.
This method is used for example in the classification vector applications to fetch the fields and values of the input vector data. The input field can be a string (possible fields are defined in the DoExecute of the applications), but the assertion will fail as the class field is an integer.
There are a few tests failing because of this issue if the otb is compiled in debug mode (which does not happen or CI nor Dashboard if I'm correct). If we want to keep this assertion, we should replace GetValue<T> by GetFieldAsXXX in classification applications.7.0.0Cédric TraizetCédric Traizethttps://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1907"External libraries used in OTB" table is missing from nightly doc2019-07-23T09:25:53ZVictor Poughon"External libraries used in OTB" table is missing from nightly docIn the documentation, in the section "Compiling OTB from source" there is a table called "External libraries used in OTB". It appears in my local build but not in the nightly build: https://www.orfeo-toolbox.org/packages/nightly/latest/C...In the documentation, in the section "Compiling OTB from source" there is a table called "External libraries used in OTB". It appears in my local build but not in the nightly build: https://www.orfeo-toolbox.org/packages/nightly/latest/CookBook-6.7/CompilingOTBFromSource.html7.0.0https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/1904Improve BandMathX documentation2019-09-13T09:51:29ZCédric TraizetImprove BandMathX documentationThe documentation of BandMathX in the Cookbook is a bit confusing:
- There is the [application documentation](https://www.orfeo-toolbox.org/packages/nightly/latest/CookBook-6.7/Applications/app_BandMathX.html): the documentation is quit...The documentation of BandMathX in the Cookbook is a bit confusing:
- There is the [application documentation](https://www.orfeo-toolbox.org/packages/nightly/latest/CookBook-6.7/Applications/app_BandMathX.html): the documentation is quite long but non exhaustive.
- There is the `About BandMathX` C++ API section. It contains information on the BandMathX syntax and C++ example. It contains a lot of details on advanced use of BandMathX, and describes additional functionalities beside `MuParserX`. This section comes from the Software Guide migration.
- Document bit manipulation as it should be used with the `int` operator
Most users of `BandMathX` are using the application, and will never open the C++ API section. I think the documentation should be refactored as follow:
- All the syntax related information should go in BandMathX's documentation.
- The `About BandMathX` C++ API section should be removed, and the C++ part should be moved to the examples (or not, there is already an example for the BandMathX filter).
- We could add an example of the BandMathX application in this [recipe](https://www.orfeo-toolbox.org/CookBook-develop/recipes/improc.html), to point out the differences with `BandMath`7.0.0Cédric TraizetCédric Traizet