[Git][debian-gis-team/otb][upstream] New upstream version 8.1.0~rc1+dfsg

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Thu Aug 11 17:57:35 BST 2022



Bas Couwenberg pushed to branch upstream at Debian GIS Project / otb


Commits:
e992e618 by Bas Couwenberg at 2022-08-11T18:30:24+02:00
New upstream version 8.1.0~rc1+dfsg
- - - - -


30 changed files:

- CMakeLists.txt
- CONTRIBUTING.md
- + Data/Baseline/OTB/Images/apTvPrOrthorectification_OTB_Metadata.tif
- + Data/Baseline/OTB/Images/ioExtractROI_JPEG2K_2_TIF_s2_150_75_100_50.tif
- + Data/Baseline/OTB/Images/ioExtractROI_JPEG2K_2_TIF_s2_res1.tif
- Data/Baseline/OTB/Images/prTvOrthoRectification_pleiades-1_DEMGTIFF.tif
- Data/Baseline/OTB/Images/prTvOrthoRectification_pleiades-1_DEMSRTM.tif
- Data/Baseline/OTB/Images/prTvOrthoRectification_pleiades-1_noDEM.tif
- + Data/Input/QB_TOULOUSE_11_11.tif
- Data/Input/pleiades/pleiades-1.gcp2
- + Data/Input/s2a_l2a_t30uxu_20220317T111749.jp2
- Modules/Applications/AppMathParser/app/otbBandMath.cxx
- Modules/Applications/AppProjection/test/CMakeLists.txt
- Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx
- Modules/Core/Functor/include/otbFunctorImageFilter.h
- Modules/Core/ImageBase/test/CMakeLists.txt
- Modules/Core/Metadata/include/otbGeomMetadataSupplier.h
- Modules/Core/Metadata/src/otbGeomMetadataSupplier.cxx
- Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx
- Modules/Core/Transform/test/CMakeLists.txt
- Modules/Core/Transform/test/otbRPCTransformTest.cxx
- Modules/IO/IOGDAL/include/otbGDALImageIO.h
- Modules/IO/IOGDAL/src/otbDEMHandler.cxx
- Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
- Modules/IO/IOGDAL/test/CMakeLists.txt
- Modules/IO/IOGDAL/test/otbGDALRPCTransformerTest2.cxx
- Modules/IO/ImageIO/include/otbImageFileReader.hxx
- Modules/Wrappers/ApplicationEngine/include/otbWrapperListViewParameter.h
- Modules/Wrappers/SWIG/src/otbApplication.i
- RELEASE_NOTES.txt


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -152,8 +152,8 @@ set(main_project_name ${_OTBModuleMacros_DEFAULT_LABEL})
 #-----------------------------------------------------------------------------
 # OTB version number.
 set(OTB_VERSION_MAJOR "8")
-set(OTB_VERSION_MINOR "0")
-set(OTB_VERSION_PATCH "1")
+set(OTB_VERSION_MINOR "1")
+set(OTB_VERSION_PATCH "0")
 set(OTB_VERSION_STRING "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH}")
 
 get_package_name(${OTB_SOURCE_DIR} ${PROJECT_NAME} OTB_VERSION_STRING2)


=====================================
CONTRIBUTING.md
=====================================
@@ -17,62 +17,66 @@ use a self-hosted GitLab instance:
 
 [`https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb`](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb)
 
-Remember to check out also our [forum](https://forum.orfeo-toolbox.org/),
-where we discuss some features, improvements and high level project planning.
-You are welcome to ask questions there as a beginner or future OTB contributor!
+Remember to check out also our [forum](https://forum.orfeo-toolbox.org/), where
+we discuss some features, improvements and high level project planning.  You are
+welcome to ask questions there as a beginner or future OTB contributor!
 
 ## Reporting bugs
 
-If you have found a bug, you can first [search the existing issues](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues?label_name%5B%5D=bug)
+If you have found a bug, you can first [search the existing
+issues](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues?label_name%5B%5D=bug)
 to see if it has already been reported.
 
-If it's a new bug, please [open a new issue on GitLab](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues/new).
-The 'Bug' issue template will help you provide all important information and
-help fixing the bug quicker. Remember to add as much information as possible!
+If it's a new bug, please [open a new issue on
+GitLab](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues/new).  The
+'Bug' issue template will help you provide all important information and help
+fixing the bug quicker. Remember to add as much information as possible!
 
 ## Feature requests and discussions
 
-Feature requests are welcome! Generally you are welcome to simply [open an issue](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues)
-and discuss your idea there. For more complex requests there is an issue
-template for in depth description called 'Request for Comments'.
+Feature requests are welcome! Generally you are welcome to simply [open an
+issue](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues) and discuss
+your idea there. For more complex requests there is an issue template for in
+depth description called 'Request for Comments'.
 
 
 ## Documentation improvements
 
-The main OTB documentation is
-the [CookBook](https://www.orfeo-toolbox.org/CookBook/).  The source is
-hosted in the main OTB repository in the `Documentation/` directory. Then, to
-contribute documentation use the same workflow as for code contributions (see
-below).
+The main OTB documentation is the
+[CookBook](https://www.orfeo-toolbox.org/CookBook/).  The source is hosted in
+the main OTB repository in the `Documentation/` directory. Then, to contribute
+documentation use the same workflow as for code contributions (see below).
 
-See also the "Compiling documentation" section of the CookBook
-for help on building the Sphinx source.
+See also the "Compiling documentation" section of the CookBook for help on
+building the Sphinx source.
 
 ## Code contribution
 
-The OTB workflow is based on GitLab [Merge Requests](https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html).
+The OTB workflow is based on GitLab [Merge
+Requests](https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html).
 Clone the repository, create a feature branch, commit your changes, push the
 feature branch to a fork (or the main repository if you are a core developer),
 then send a merge request.
 
-Note that we also accept PRs on our [GitHub mirror](https://github.com/orfeotoolbox/OTB)
-which we will manually merge.
+Note that we also accept PRs on our [GitHub
+mirror](https://github.com/orfeotoolbox/OTB) which we will manually merge.
 
-Feature branches are tested on multiple platforms on the OTB
-[CI infrastructure](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/pipelines). 
+Feature branches are tested on multiple platforms on the OTB [CI
+infrastructure](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/pipelines).
 
-Caveat: even if the CI build on develop branch is broken, it is not
-allowed to push fixes directly on develop. The developer trying to fix the
-build should create a merge request and submit it for review. Direct push to
-develop without review must be avoided.
+Caveat: even if the CI build on develop branch is broken, it is not allowed to
+push fixes directly on develop. The developer trying to fix the build should
+create a merge request and submit it for review. Direct push to develop without
+review must be avoided.
 
 ### Commit message
 
 On your feature branch, write a good [commit message](https://xkcd.com/1296/):
 short and descriptive. If fixing an issue or bug, put the issue number in the
-commit message so that GitLab can [cross-link it](https://docs.gitlab.com/ce/user/project/issues/crosslinking_issues.html).
-You can prefix your commit message with an indicating flag (DOC, BUG, PKG,
-TEST, SuperBuild, etc.).
+commit message so that GitLab can [cross-link
+it](https://docs.gitlab.com/ce/user/project/issues/crosslinking_issues.html).
+You can prefix your commit message with an indicating flag (DOC, BUG, PKG, TEST,
+SuperBuild, etc.).
 
 Standard prefixes for OTB commit messages:
 
@@ -97,10 +101,15 @@ Request against the `develop` branch on GitLab using the merge request
 template. The merge request will then be discussed by the community and the core
 OTB team.
 
-* Merge requests can not be merged until all discussions have been resolved (this is enforced by GitLab)
-* Merge requests **must receive at least 2 positives votes from core developers** (members of Main Repositories group in Gitlab with at least "Developer" level; this includes PSC members) before being merged
-* The merger is responsible for checking that the branch is up-to-date with develop
-* Merge requests can be merged by anyone (not just PSC or RM) with push access to develop
+* Merge requests can not be merged until all discussions have been resolved
+  (this is enforced by GitLab)
+* Merge requests **must receive at least 2 positives votes from core
+  developers** (members of Main Repositories group in GitLab with at least
+  "Developer" level; this includes PSC members) before being merged
+* The merger is responsible for checking that the branch is up-to-date with
+  develop
+* Merge requests can be merged by anyone (not just PSC or RM) with push access
+  to develop
 * Merge requests can be merged once the CI pipeline passes successfully. See
   next section for details on the CI pipelines.
 
@@ -109,16 +118,16 @@ OTB team.
 
 There isn't much to do in order to use the CI platform. The CI pipelines are
 triggered automatically when pushing commits. However, if you push to a fork,
-you will first need an access to the Runners from main repository. You
-can request it when doing your first MergeRequest. During code review, someone
-from CI admins will assign the runners to your fork.
+you will first need an access to the Runners from main repository. You can
+request it when doing your first Merge Request. During code review, someone from
+CI admins will assign the runners to your fork.
 
 When your pipeline ends, there are two cases:
 
 * if all the jobs succeed, you see a green pipeline, which means no problem was
   found on your commit.
 * if one job fails, you see a red pipeline, which means something is broken in
-  your commit. The pipeline widget on Gitlab will tell you which job failed, so
+  your commit. The pipeline widget on GitLab will tell you which job failed, so
   you can check the logs. There, you may also find links to
   [CDash](https://cdash.orfeo-toolbox.org/index.php?project=OTB) submissions
   where compilation errors and failed test can be investigated more easily.
@@ -134,8 +143,8 @@ purpose of this CLA is to ensure that the project has the necessary ownership or
 grants of rights over all contributions to allow them to distribute under the
 chosen license (Apache License Version 2.0)
 
-To accept your contribution, we need you to complete, sign and email to *cla [at]
-orfeo-toolbox [dot] org* an [Individual Contributor Licensing
+To accept your contribution, we need you to complete, sign and email to *cla
+[at] orfeo-toolbox [dot] org* an [Individual Contributor Licensing
 Agreement](https://www.orfeo-toolbox.org/cla/icla-en.doc) (ICLA) form and a
 [Corporate Contributor Licensing
 Agreement](https://www.orfeo-toolbox.org/cla/ccla-en.doc) (CCLA) form if you are
@@ -148,33 +157,95 @@ file](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/raw/develop/NOTICE).
 
 ## Remote modules
 
-Remote Modules are the preferred way if you wish to make your apps and filters available to the
-community while keeping control and maintenance of their sources. Those
-modules are just like regular modules, except they are not distributed inside
-OTB source code. For more information, see [the CookBook](https://www.orfeo-toolbox.org/CookBook-develop/RemoteModules.html)
+Remote Modules are the preferred way if you wish to make your apps and filters
+available to the community while keeping control and maintenance of their
+sources. Those modules are just like regular modules, except they are not
+distributed inside OTB source code. For more information, see [the
+CookBook](https://www.orfeo-toolbox.org/CookBook-develop/RemoteModules.html)
 
 ## GitLab guidelines
 
 In order to organize the issues in our GitLab instance, we use both labels and
 milestones.
 
-The [milestones](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/milestones) should be used to track in which release a feature is merged.
-GitLab can then provide a summary of all features and bugs added to a given release
-version.
+The [milestones](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/milestones)
+should be used to track in which release a feature is merged.  GitLab can then
+provide a summary of all features and bugs added to a given release version.
 
 Regarding labels, we use the following set:
-* ~story: significant feature to be implemented with a detailed work plan, it can
-  correspond to a Request for Comments that has turned into a development action
-* ~bug: Bug, crash or unexpected behavior, reported by a user or a developer
-* ~feature: Feature request expressed by an OTB user/developer
-* ~patch: A small patch fixing build warnings, compilation errors, typos in logs or documentation
-* ~"To Do": action is planned
-* ~Doing: work in progress
-* ~api ~app ~documentation ~monteverdi ~packaging ~qgis: optional context information
+
+| Label                                              | Description                                                                                                                                            |
+|----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
+| ~story                                             | Significant feature to be implemented with a detailed work plan, it can correspond to a Request for Comments that has turned into a development action |
+| ~bug                                               | Bug, crash or unexpected behavior, reported by a user or a developer                                                                                   |
+| ~feature                                           | Feature request expressed by an OTB user/developer                                                                                                     |
+| ~usage                                             | Question related to OTB's usage                                                                                                                        |
+| ~patch                                             | A small patch fixing build warnings, compilation errors, typos in logs or documentation                                                                |
+| ~"to investigate"                                  | This issue needs a complete analysis                                                                                                                   |
+| ~"CNES backlog"                                    | The CNES could fund this issue but it has not been assigned to a milestone yet                                                                            |
+| ~"To Do"                                           | Action is planned                                                                                                                                      |
+| ~Doing                                             | Work in progress                                                                                                                                       |
+| ~"Waiting for answer"                              | Waiting for an answer or for a detailed context                                                                                                        |
+| ~breaking                                          | Changes introduced by this issue will break the API                                                                                                    |
+| ~refactoring                                       | Issue related to improvements like refactoring, tests, maintenance, etc                                                                                |
+| ~documentation                                     | Documentation improvements|
+| ~ci                                                | Issue related to the continuous integration platform                                                                                                  |
+| ~api ~app ~legal ~monteverdi <br> ~packaging ~qgis | Optional context information                                                                                                                           |
+  
+## Issue life cycle
+
+When an issue is open, the core development team will review it in a
+first analysis. During this first analysis, the team will evaluate is
+the issue is a ~bug, a ~feature request or related to an ~usage. The
+team may also ask for more information.
+
+### Bugs
+
+Sometimes, the first analysis shows that the issue is related to a
+misuse of the OTB. In that case, the issue is redefined to ~usage.
+
+It happens that the bug is trivial to correct or a workaround is easy
+to set up. In this case, it is corrected directly, or the workaround
+is documented, and the issue is closed. If the bug is not trivial, the
+team will proceed to a second, more complete, analysis. During this
+analysis, the issue is marked as ~"to investigate". This is a time to
+iterate with the author of the issue to find the best way to address
+it. At the end of this analysis, the issue's description should
+contain the proposition of correction, the impact for the code and the
+test, the validation criterion, and an estimation of the
+implementation schedule. Sometimes, a workaround can be proposed in
+place of a correction.
+
+As the main funder of the project, the CNES may support the funding
+for the correction, but it is not systematic, since its funds are
+limited. In case of CNES funding, the issue is assigned to a milestone
+(the next minor release or the next major release).
+
+### Feature request
+
+The core development team will proceed to a second, more complete,
+analysis. During this analysis, the issue is marked as ~"to
+investigate". This is a time to iterate with the author of the issue
+to find the best way to address it. At the end of this analysis, the
+issue's description should contain the conception of the new feature,
+the impact for the users, the code and the test, the validation
+criterion, and an estimation of the implementation schedule. In case
+of CNES funding, the issue is assigned to a milestone (the next minor
+release or the next major release). If the request doesn't correspond
+to the roadmap of those milestone, the label ~"CNES backlog" is set to
+the issue.
+
+### Usage
+
+When someone asks a question about the usage of the OTB, or doesn't understand
+some functionalities, the community will be pleased to help them by answering
+the questions and providing some support. This kind of issues are also an
+opportunity to improve the documentation and make the OTB easier to use.
 
 ## Versioning
 
-Starting from OTB 7.0.0, we use [semantic versioning](https://semver.org/). See the website for the full spec, in summary:
+Starting from OTB 7.0.0, we use [semantic versioning](https://semver.org/). See
+the website for the full spec, in summary:
 
 > Given a version number MAJOR.MINOR.PATCH, increment the:
 >
@@ -184,8 +255,14 @@ Starting from OTB 7.0.0, we use [semantic versioning](https://semver.org/). See
 >
 > Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
 
-The develop branch is always the place where the upcoming major or minor release is worked on. Patch releases are done on release branches, for example 7.0.1 and 7.0.2 could be found on the release-7.0 branch.
+The develop branch is always the place where the upcoming major or minor release
+is worked on. Patch releases are done on release branches, for example 7.0.1 and
+7.0.2 could be found on the release-7.0 branch.
 
-For the purpose of defining backwards compatibility, the OTB API covers (not an exhaustive list): the C++ API, the Python bindings, application names, application parameters, output format and interpretation of input data.
+For the purpose of defining backwards compatibility, the OTB API covers (not an
+exhaustive list): the C++ API, the Python bindings, application names,
+application parameters, output format and interpretation of input data.
 
-When we deprecate part of our public API, we should do two things: (1) update our documentation to let users know about the change, (2) issue a new minor or major release with the deprecation in place.
+When we deprecate part of our public API, we should do two things: (1) update
+our documentation to let users know about the change, (2) issue a new minor or
+major release with the deprecation in place.


=====================================
Data/Baseline/OTB/Images/apTvPrOrthorectification_OTB_Metadata.tif
=====================================
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85a028b0cbeec272341f732c2ccc530d54443bdc3f0478cf1192a6d732d5c1a9
+size 4262


=====================================
Data/Baseline/OTB/Images/ioExtractROI_JPEG2K_2_TIF_s2_150_75_100_50.tif
=====================================
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:52be405fc52c979645c2c2ce83f34631e5db4ce92ed728322f239887501780a1
+size 15608


=====================================
Data/Baseline/OTB/Images/ioExtractROI_JPEG2K_2_TIF_s2_res1.tif
=====================================
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7d3f2a7a4fb6337b6a3cf7fa29f61e0214720787dd2e68fd25e18362f5002569
+size 197364


=====================================
Data/Baseline/OTB/Images/prTvOrthoRectification_pleiades-1_DEMGTIFF.tif
=====================================
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:2200368da4dd12399e3df5c476891bf552d240d35be343c41c650d059b12ba00
-size 9589024
+oid sha256:06e9ec7f39f6289d72f7bd9d7ff258a5ee264f6695e21bedeac32da30396f920
+size 8014228


=====================================
Data/Baseline/OTB/Images/prTvOrthoRectification_pleiades-1_DEMSRTM.tif
=====================================
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:32cc257b2f2ea4bacba7b420cc6a3d8031f99831f6a9350fe5a51f5df449f5ca
-size 9587130
+oid sha256:fefb90eed77369bd63d6de4922ed04ae5810d36a09bf322ff041e6a70340ae5a
+size 8014228


=====================================
Data/Baseline/OTB/Images/prTvOrthoRectification_pleiades-1_noDEM.tif
=====================================
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b2b3e7d8702bca56b16ca6e5f89522451354a718588b0f65a09f9449fc5e7a8c
-size 9586558
+oid sha256:d44b0600974780121bfe07db87863bc841266076f9e1b4b1e1f10c2acb19fe80
+size 8014228


=====================================
Data/Input/QB_TOULOUSE_11_11.tif
=====================================
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a7cbea8d48e68082f86215859000fa5b46c2025572233b16ba787b030a089cb7
+size 4882


=====================================
Data/Input/pleiades/pleiades-1.gcp2
=====================================
@@ -1,37 +1,36 @@
-# column row longitude latitude elevation
-10 10 1.3619678304742049 43.685679307528154 255.0
-60 10 1.362269915752421 43.68568138233786 255.0
-110 10 1.3625720040752514 43.68568345638775 255.0
-160 10 1.3628740954430656 43.68568552967785 255.0
-210 10 1.3631761898562327 43.685687602208176 255.0
-260 10 1.3634782873151208 43.68568967397878 255.0
-10 60 1.3619690059603062 43.68545371966921 255.0
-60 60 1.362271090845755 43.685455793356994 255.0
-110 60 1.3625731787760083 43.68545786628494 255.0
-160 60 1.3628752697514357 43.685459938453086 255.0
-210 60 1.3631773637724058 43.68546200986146 255.0
-260 60 1.3634794608392868 43.685464080510094 255.0
-10 110 1.3619701802586466 43.68522813138672 255.0
-60 110 1.362272264751236 43.685230203952486 255.0
-110 110 1.3625743522888205 43.68523227575841 255.0
-160 110 1.36287644287177 43.68523434680452 255.0
-210 110 1.363178536500452 43.68523641709085 255.0
-260 110 1.3634806331752352 43.685238486617436 255.0
-10 160 1.3619713533675186 43.685002542681254 255.0
-60 160 1.3622734374671568 43.68500461412492 255.0
-110 160 1.3625755246119815 43.685006684808734 255.0
-160 160 1.3628776148023616 43.68500875473273 255.0
-210 160 1.3631797080386652 43.68501082389693 255.0
-260 160 1.3634818043212602 43.68501289230138 255.0
-10 210 1.3619725252852164 43.68477695355337 255.0
-60 210 1.362274608991812 43.68477902387485 255.0
-110 210 1.3625766957437855 43.68478109343648 255.0
-160 210 1.3628787855415057 43.684783162238276 255.0
-210 210 1.3631808783853407 43.684785230280276 255.0
-260 210 1.3634829742756576 43.68478729756251 255.0
-10 260 1.361973696010035 43.684551364003646 255.0
-60 260 1.3622757793234972 43.68455343320287 255.0
-110 260 1.362577865682529 43.68455550164222 255.0
-160 260 1.362879955087499 43.68455756932174 255.0
-210 260 1.363182047538775 43.684559636241445 255.0
-260 260 1.3634841430367244 43.68456170240138 255.0
+10 10 1.361964797875297 43.68568154265233 255
+10 60 1.3619659733772 43.68545595480884 255
+10 110 1.361967147691359 43.68523036654181 255
+10 160 1.361968320816069 43.68500477785178 255
+10 210 1.361969492749621 43.68477918873934 255
+10 260 1.361970663490313 43.68455359920505 255
+60 10 1.362266883126997 43.68568361748085 255
+60 60 1.362268058236132 43.68545802851544 255
+60 110 1.362269232157431 43.68523243912639 255
+60 160 1.362270404889188 43.68500684931427 255
+60 210 1.362271576429697 43.68478125907965 255
+60 260 1.362272746777254 43.6845556684231 255
+110 10 1.362568971423306 43.68568569154957 255
+110 60 1.362570146139862 43.68546010146221 255
+110 110 1.362571319668492 43.68523451095113 255
+110 160 1.362572492007488 43.68500892001691 255
+110 210 1.362573663155145 43.6847833286601 255
+110 260 1.362574833109759 43.68455773688128 255
+160 10 1.362871062764593 43.68568776485848 255
+160 60 1.362872237088761 43.68546217364918 255
+160 110 1.362873410224912 43.68523658201607 255
+160 160 1.362874582171338 43.68501098995972 255
+160 210 1.362875752926334 43.68478539748072 255
+160 260 1.362876922488197 43.68455980457963 255
+210 10 1.363173157151227 43.68568983740764 255
+210 60 1.363174331083198 43.68546424507637 255
+210 110 1.363175503827059 43.68523865232122 255
+210 160 1.363176675381105 43.68501305914275 255
+210 210 1.363177845743632 43.68478746554155 255
+210 260 1.363179014912935 43.68456187151816 255
+260 10 1.363475254583577 43.68569190919705 255
+260 60 1.363476428123539 43.68546631574382 255
+260 110 1.363477600475302 43.68524072186663 255
+260 160 1.363478771637159 43.68501512756603 255
+260 210 1.363479941607406 43.6847895328426 255
+260 260 1.363481110384341 43.68456393769691 255


=====================================
Data/Input/s2a_l2a_t30uxu_20220317T111749.jp2
=====================================
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:59d72c390101c59eaac92bd5bfe12b02fee6bf70f218021b37df803ca7ba7153
+size 40748


=====================================
Modules/Applications/AppMathParser/app/otbBandMath.cxx
=====================================
@@ -232,6 +232,7 @@ private:
 
     // Set the output image
     SetParameterOutputImage("out", m_Filter->GetOutput());
+    RegisterPipeline();
   }
 
   ExtractROIFilterType::Pointer     m_ExtractROIFilter;


=====================================
Modules/Applications/AppProjection/test/CMakeLists.txt
=====================================
@@ -98,6 +98,14 @@ otb_test_application(NAME  apTvPrOrthorectification_UTM
                               ${BASELINE}/owTvOrthorectifTest_UTM.tif
                  			  ${TEMP}/apTvPrOrthorectifTest_UTM.tif)
 
+otb_test_application(NAME apTvPrOrthorectification_OTB_Metadata
+                     APP OrthoRectification
+                     OPTIONS -io.in ${INPUTDATA}/QB_TOULOUSE_11_11.tif
+                             -io.out ${TEMP}/apTvPrOrthorectification_OTB_Metadata.tif
+                     VALID --compare-image ${EPSILON_4}
+                           ${BASELINE}/apTvPrOrthorectification_OTB_Metadata.tif
+                           ${TEMP}/apTvPrOrthorectification_OTB_Metadata.tif)
+
 #otb_test_application(NAME  apTvPrOrthorectification_DEMTIF_UTM_OutXML1
                      #APP  OrthoRectification
                      #OPTIONS -io.in LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}


=====================================
Modules/Applications/AppTextures/app/otbHaralickTextureExtraction.cxx
=====================================
@@ -131,11 +131,15 @@ private:
                             "texture parameters.");
 
     AddParameter(ParameterType_Int, "parameters.xrad", "X Radius");
-    SetParameterDescription("parameters.xrad", "X Radius");
+    SetParameterDescription("parameters.xrad",
+                            "X Radius of the neighborhood window. The formula used to retrieve the size of "
+                            "the window is ``2 * radius + 1``.");
     SetDefaultParameterInt("parameters.xrad", 2);
 
     AddParameter(ParameterType_Int, "parameters.yrad", "Y Radius");
-    SetParameterDescription("parameters.yrad", "Y Radius");
+    SetParameterDescription("parameters.yrad",
+                            "Y Radius of the neighborhood window. The formula used to retrieve the size of "
+                            "the window is ``2 * radius + 1``.");
     SetDefaultParameterInt("parameters.yrad", 2);
 
     AddParameter(ParameterType_Int, "parameters.xoff", "X Offset");


=====================================
Modules/Core/Functor/include/otbFunctorImageFilter.h
=====================================
@@ -107,7 +107,7 @@ struct IsSuitableType<itk::RGBAPixel<T>> : IsSuitableType<T>::type
  * T                                                -> PixelType = T
  * const ConstNeighborhoodIterator<Image::T>&       -> PixelType = T
  * const ConstNeighborhoodIterator<VectorImage::T>& -> PixelType = itk::VariableLengthVector<T>
-*/
+ */
 template <class T>
 struct PixelTypeDeduction
 {
@@ -158,13 +158,13 @@ template <typename T>
 using RemoveCVRef = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
 
 /**
-* \struct RetrieveOperator
-*
-* \brief Struct to retrieve the operator type
-*
-* \tparam T the type to retrieve operator() from
-*
-*/
+ * \struct RetrieveOperator
+ *
+ * \brief Struct to retrieve the operator type
+ *
+ * \tparam T the type to retrieve operator() from
+ *
+ */
 template <typename T>
 struct RetrieveOperator
 {
@@ -173,17 +173,17 @@ struct RetrieveOperator
 };
 
 /**
-* \struct FunctorFilterSuperclassHelper
-* \brief Struct allowing to derive the superclass prototype for the
-*        FunctorImageFilter class
-*
-* Provides the following:
-* - OutputImageType : type of the output image
-* - FilterType : correct instantiation of VariadicInputsImageFilter from
-* - the operator() prototype
-* - InputHasNeighborhood a tuple of N false_type or true_type to denote
-* - if Ith arg of operator() expects a neighborhood.
-*/
+ * \struct FunctorFilterSuperclassHelper
+ * \brief Struct allowing to derive the superclass prototype for the
+ *        FunctorImageFilter class
+ *
+ * Provides the following:
+ * - OutputImageType : type of the output image
+ * - FilterType : correct instantiation of VariadicInputsImageFilter from
+ * - the operator() prototype
+ * - InputHasNeighborhood a tuple of N false_type or true_type to denote
+ * - if Ith arg of operator() expects a neighborhood.
+ */
 template <typename T, typename TNameMap>
 struct FunctorFilterSuperclassHelper : public FunctorFilterSuperclassHelper<typename RetrieveOperator<T>::Type, TNameMap>
 {
@@ -316,7 +316,7 @@ auto NewFunctorFilter(Functor f, itk::Size<2> radius = {{0, 0}});
  * \ingroup IntensityImageFilters   Multithreaded Streamed
  *
  * \ingroup OTBFunctor
-*/
+ */
 template <class TFunction, class TNameMap = void>
 class ITK_EXPORT FunctorImageFilter : public FunctorFilterSuperclassHelper<TFunction, TNameMap>::FilterType
 {
@@ -487,7 +487,7 @@ private:
  */
 
 template <typename Functor, typename TNameMap = void>
-auto NewFunctorFilter(Functor f, unsigned int numberOfOutputBands, itk::Size<2> radius)
+auto NewFunctorFilter(Functor f, unsigned int numberOfOutputBands, itk::Size<2> radius = {{0, 0}})
 {
   using FunctorType = NumberOfOutputBandsDecorator<Functor>;
   FunctorType decoratedF(f, numberOfOutputBands);


=====================================
Modules/Core/ImageBase/test/CMakeLists.txt
=====================================
@@ -630,22 +630,22 @@ otb_add_test(NAME   ioTvMultiChannelROI_p1_06_JPEG2000_2_TIF_res0 COMMAND otbIma
 
 # Read an area inside one tile at resolution 0 (quite similar coding parameter with pleiade
 # except it a lossless image with no quatization style).
-otb_add_test(NAME   ioTvMultiChannelROI_lena_JPEG2000_2_TIF_res0 COMMAND otbImageBaseTestDriver
-  --compare-image ${EPSILON_9}   ${BASELINE}/ioExtractROI_JPEG2K_2_TIF_lena_150_75_100_50.tif
-  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_lena_150_75_100_50_OUT.tif
+otb_add_test(NAME   ioTvMultiChannelROI_s2_JPEG2000_2_TIF_res0 COMMAND otbImageBaseTestDriver
+  --compare-image ${EPSILON_9}   ${BASELINE}/ioExtractROI_JPEG2K_2_TIF_s2_150_75_100_50.tif
+  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_s2_150_75_100_50_OUT.tif
   otbMultiChannelExtractROI
-  ${INPUTDATA}/lena512color.jp2?&resol=0
-  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_lena_150_75_100_50_OUT.tif
+  ${INPUTDATA}/s2a_l2a_t30uxu_20220317T111749.jp2?&resol=0
+  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_s2_150_75_100_50_OUT.tif
   -startX 150 -startY 75 -sizeX 100 -sizeY 50 )
 
 # Read an area inside one tile at resolution 5 (quite similar coding parameter with pleiade
 # except it a lossless image with no quatization style).
-otb_add_test(NAME   ioTvMultiChannelROI_lena_JPEG2000_2_TIF_res1 COMMAND otbImageBaseTestDriver
-  --compare-image ${EPSILON_9}   ${BASELINE}/ioExtractROI_JPEG2K_2_TIF_lena_res1.tif
-  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_lena_res1_OUT.tif
+otb_add_test(NAME   ioTvMultiChannelROI_s2_JPEG2000_2_TIF_res1 COMMAND otbImageBaseTestDriver
+  --compare-image ${EPSILON_9}   ${BASELINE}/ioExtractROI_JPEG2K_2_TIF_s2_res1.tif
+  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_s2_res1_OUT.tif
   otbMultiChannelExtractROI
-  ${INPUTDATA}/lena512color.jp2?&resol=1
-  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_lena_res1_OUT.tif
+  ${INPUTDATA}/s2a_l2a_t30uxu_20220317T111749.jp2?&resol=1
+  ${TEMP}/ioExtractROI_JPEG2K_2_TIF_s2_res1_OUT.tif
   )
 
 


=====================================
Modules/Core/Metadata/include/otbGeomMetadataSupplier.h
=====================================
@@ -70,7 +70,7 @@ public:
    *
    * @param imd The ImageMetadata to fill
    */
-  bool FetchRPC(ImageMetadata & imd);
+  bool FetchRPC(ImageMetadata & imd, const double lineOffset=0, const double sampleOffset=0);
 
   /**
    * @brief Fill the ImageMetadata with the GCP from the geom file


=====================================
Modules/Core/Metadata/src/otbGeomMetadataSupplier.cxx
=====================================
@@ -93,7 +93,9 @@ int GeomMetadataSupplier::GetNbBands() const
   return 1;
 }
 
-bool GeomMetadataSupplier::FetchRPC(ImageMetadata & imd)
+bool GeomMetadataSupplier::FetchRPC(ImageMetadata & imd,
+                                    const double lineOffset,
+                                    const double sampleOffset)
 {
   bool hasValue;
   GetMetadataValue("polynomial_format", hasValue);
@@ -101,8 +103,8 @@ bool GeomMetadataSupplier::FetchRPC(ImageMetadata & imd)
     return false;
 
   Projection::RPCParam rpcStruct;
-  rpcStruct.LineOffset    = this->GetAs<double>("line_off");
-  rpcStruct.SampleOffset  = this->GetAs<double>("samp_off");
+  rpcStruct.LineOffset    = this->GetAs<double>("line_off") + lineOffset;
+  rpcStruct.SampleOffset  = this->GetAs<double>("samp_off") + sampleOffset;
   rpcStruct.LatOffset     = this->GetAs<double>("lat_off");
   rpcStruct.LonOffset     = this->GetAs<double>("long_off");
   rpcStruct.HeightOffset  = this->GetAs<double>("height_off");


=====================================
Modules/Core/Metadata/src/otbPleiadesImageMetadataInterface.cxx
=====================================
@@ -594,7 +594,7 @@ void PleiadesImageMetadataInterface::Parse(ImageMetadata &imd)
     // fill RPC model
     if (imd[MDStr::GeometricLevel] == "SENSOR")
     {
-      FetchRPC(imd, -0.5, -0.5);
+      FetchRPC(imd);
     }
   }
   // Product read by the DIMAP GDAL driver
@@ -613,7 +613,7 @@ void PleiadesImageMetadataInterface::Parse(ImageMetadata &imd)
     // fill RPC model
     if (imd[MDStr::GeometricLevel] == "SENSOR")
     {
-      FetchRPC(imd, -0.5, -0.5);
+      FetchRPC(imd);
     }
   }
   // Geom case


=====================================
Modules/Core/Transform/test/CMakeLists.txt
=====================================
@@ -100,14 +100,21 @@ otb_add_test(NAME trTvRPCTransformTest_worldview2 COMMAND otbTransformTestDriver
   0.1 # ImgTol
   )
 
+#For issue 2293, the baseline pleaides-1.geom had a shift of 0.5 pixels
+#in the geom generated with OTB 7.4, the baseline was wrong. To keep the compatibility, we added this shift in the tests
 otb_add_test(NAME trTvRPCTransformTest_pl_hnord_geom COMMAND otbTransformTestDriver
   otbRPCTransformTest
   ${INPUTDATA}/pleiades/pleiades-1.geom # Geom
   ${INPUTDATA}/pleiades/pleiades-1.gcp2 # GCP
   0.02 # GeoTol
   0.1 # ImgTol
+  0.5 # lineOffset
+  0.5 # sampleOffset
   )
 
+#For issue 2293, we had to regenerate the baseline pleiades-1.gcp2 because there was a shift
+#in the gcps that was fixed by the MR 918
+#To regenerate the gcps, see the wiki on the gitlab
 otb_add_test(NAME trTvRPCTransformTest_pl_hnord_product COMMAND otbTransformTestDriver
   otbRPCTransformTest
   LARGEINPUT{PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R1C1.JP2} # Product


=====================================
Modules/Core/Transform/test/otbRPCTransformTest.cxx
=====================================
@@ -41,7 +41,7 @@ using GenericRSTransformType = otb::GenericRSTransform<double, 3, 3>;
 using DistanceType = itk::Statistics::EuclideanDistanceMetric<PointType>;
 using GeographicalDistanceType = otb::GeographicalDistance<PointType>;
 
-int otbRPCTransformTest(int itkNotUsed(argc), char* argv[])
+int otbRPCTransformTest(int argc, char* argv[])
 {
   bool success = true;
   PointType imagePoint;
@@ -52,6 +52,13 @@ int otbRPCTransformTest(int itkNotUsed(argc), char* argv[])
   std::string gcpFileName(argv[2]);
   double geoTol(atof(argv[3]));
   double imgTol(atof(argv[4]));
+  double lineOffset(0);
+  double sampleOffset(0);
+  if(argc == 7)
+  {
+    lineOffset = atof(argv[5]);
+    sampleOffset = atof(argv[6]);
+  }
 
   // Tools
   auto imgDistance = DistanceType::New();
@@ -69,7 +76,7 @@ int otbRPCTransformTest(int itkNotUsed(argc), char* argv[])
     for (int loop = 0 ; loop < geomSupplier.GetNbBands() ; ++loop)
       imd.Bands.emplace_back();
     otb::ImageMetadataInterfaceFactory::CreateIMI(imd, geomSupplier);
-    geomSupplier.FetchRPC(imd);
+    geomSupplier.FetchRPC(imd, lineOffset, sampleOffset);
   }
   else
   {


=====================================
Modules/IO/IOGDAL/include/otbGDALImageIO.h
=====================================
@@ -34,6 +34,8 @@
 #include "OTBIOGDALExport.h"
 #include "otbSpatialReference.h"
 
+class GDALDataset;
+
 namespace otb
 {
 class GDALDatasetWrapper;
@@ -247,6 +249,10 @@ protected:
   void KeywordlistToMetadata(ImageMetadataBase::Keywordlist, int band=-1);
   /** Parses a GDAL Metadata string list to fill a Keywordlist*/
   void GDALMetadataToKeywordlist(const char* const* , ImageMetadataBase::Keywordlist &);
+  /** Parses the RPC from the GDAL Metadata */
+  void GDALMetadataReadRPC();
+  /** Write the RPC to the GDAL Metadata */
+  void GDALMetadataWriteRPC(GDALDataset*);
 
   void PrintSelf(std::ostream& os, itk::Indent indent) const override;
   /** Read all information on the image*/


=====================================
Modules/IO/IOGDAL/src/otbDEMHandler.cxx
=====================================
@@ -57,14 +57,21 @@ std::vector<std::string> GetFilesInDirectory(const std::string & directoryPath)
   // End iterator : default construction yields past-the-end
   for ( const auto & item : boost::make_iterator_range(boost::filesystem::directory_iterator(directoryPath), {}) )
   {
-    if ( boost::filesystem::is_directory(item.status()) )
+    try
     {
-      auto subDirList = GetFilesInDirectory(item.path().string());
-      fileList.insert(fileList.end(), subDirList.begin(), subDirList.end());
+      if ( boost::filesystem::is_directory(item.status()) )
+      {
+	auto subDirList = GetFilesInDirectory(item.path().string());
+	fileList.insert(fileList.end(), subDirList.begin(), subDirList.end());
+      }
+      else
+      {
+	fileList.push_back(item.path().string());
+      }
     }
-    else
+    catch (boost::filesystem::filesystem_error& e)
     {
-      fileList.push_back(item.path().string());
+      otbLogMacro(Warning, << e.what())
     }
   }
 
@@ -204,6 +211,16 @@ void DEMHandler::OpenDEMFile(const std::string& path)
 
 void DEMHandler::OpenDEMDirectory(const std::string& DEMDirectory)
 {
+  auto isSameDirectory = [&DEMDirectory](std::string const& s)
+			 {
+			   return s == DEMDirectory;
+			 };
+  if(std::any_of(std::begin(m_DEMDirectories), std::end(m_DEMDirectories), isSameDirectory))
+  {
+    otbLogMacro(Info, << "Directory '"<< DEMDirectory << "' already opened.")
+    return;
+  }
+  
   // Free the previous in-memory dataset (if any)
   if (!m_DatasetList.empty())
     VSIUnlink(DEM_DATASET_PATH.c_str());


=====================================
Modules/IO/IOGDAL/src/otbGDALImageIO.cxx
=====================================
@@ -58,6 +58,11 @@ inline unsigned int uint_ceildivpow2(unsigned int a, unsigned int b)
   return (a + (1 << b) - 1) >> b;
 }
 
+// remove when C++17 available
+// Assert 2 array have same size, and return that size
+template<std::size_t N, class T>
+constexpr std::size_t getsize_tabs(const T(&)[N], T(&)[N]) { return N; }
+
 namespace otb
 {
 
@@ -118,7 +123,7 @@ GDALImageIO::GDALImageIO()
   m_NumberOfOverviews = 0;
   m_ResolutionFactor  = 0;
   m_BytePerPixel      = 0;
-  m_WriteRPCTags      = true;
+  m_WriteRPCTags      = false;
 
   m_epsgCode          = 0;
 }
@@ -874,7 +879,6 @@ void GDALImageIO::InternalReadImageInformation()
     for (int cpt = 0; cpt < 6; ++cpt)
       {
       VadfGeoTransform.push_back(adfGeoTransform[cpt]);
-      //~ m_Imd.GeoTransform[cpt] = adfGeoTransform[cpt];
       }
 
     itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::GeoTransformKey, VadfGeoTransform);
@@ -1288,7 +1292,6 @@ void GDALImageIO::WriteImageInformation()
 
 void GDALImageIO::InternalWriteImageInformation(const void* buffer)
 {
-  // char **     papszOptions = NULL;
   std::string driverShortName;
   m_NbBands = this->GetNumberOfComponents();
   
@@ -1488,11 +1491,15 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
   {
     std::string projectionRef( m_Imd.GetProjectionWKT() );
     dataset->SetProjection(projectionRef.c_str());
+    if (m_WriteRPCTags && m_Imd.Has(MDGeom::RPC))
+      GDALMetadataWriteRPC(dataset);
   }
   else if (m_Imd.Has(MDGeom::ProjectionProj))
   {
      std::string projectionRef( m_Imd.GetProjectionProj() );
      dataset->SetProjection(projectionRef.c_str());
+     if (m_WriteRPCTags && m_Imd.Has(MDGeom::RPC))
+       GDALMetadataWriteRPC(dataset);
   }
   /* -------------------------------------------------------------------- */
   /* Case 2: Sensor geometry                                              */
@@ -1502,29 +1509,9 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
     /* -------------------------------------------------------------------- */
     /* Set the RPC coeffs (since GDAL 1.10.0)                               */
     /* -------------------------------------------------------------------- */
-    if (m_WriteRPCTags && m_Imd.Has(MDGeom::RPC))
+    if (m_Imd.Has(MDGeom::RPC))
     {
-      const Projection::RPCParam & rpc = boost::any_cast<const Projection::RPCParam&>(m_Imd[MDGeom::RPC]);
-      otbLogMacro(Debug, << "Saving RPC to file (" << m_FileName << ")")
-      GDALRPCInfo gdalRpcStruct;
-      gdalRpcStruct.dfSAMP_OFF     = rpc.SampleOffset;
-      gdalRpcStruct.dfLINE_OFF     = rpc.LineOffset;
-      gdalRpcStruct.dfSAMP_SCALE   = rpc.SampleScale;
-      gdalRpcStruct.dfLINE_SCALE   = rpc.LineScale;
-      gdalRpcStruct.dfLAT_OFF      = rpc.LatOffset;
-      gdalRpcStruct.dfLONG_OFF     = rpc.LonOffset;
-      gdalRpcStruct.dfHEIGHT_OFF   = rpc.HeightOffset;
-      gdalRpcStruct.dfLAT_SCALE    = rpc.LatScale;
-      gdalRpcStruct.dfLONG_SCALE   = rpc.LonScale;
-      gdalRpcStruct.dfHEIGHT_SCALE = rpc.HeightScale;
-
-      memcpy(gdalRpcStruct.adfLINE_NUM_COEFF, rpc.LineNum, sizeof(double) * 20);
-      memcpy(gdalRpcStruct.adfLINE_DEN_COEFF, rpc.LineDen, sizeof(double) * 20);
-      memcpy(gdalRpcStruct.adfSAMP_NUM_COEFF, rpc.SampleNum, sizeof(double) * 20);
-      memcpy(gdalRpcStruct.adfSAMP_DEN_COEFF, rpc.SampleDen, sizeof(double) * 20);
-      char** rpcMetadata = RPCInfoToMD(&gdalRpcStruct);
-      dataset->SetMetadata(rpcMetadata, "RPC");
-      CSLDestroy(rpcMetadata);
+      GDALMetadataWriteRPC(dataset);
     }
     else if (m_Imd.Has(MDGeom::SAR))
     {
@@ -1585,6 +1572,9 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
 
     // disable geotransform with GCP (check that SetGCPs succeed by verifying the the dataset has GCPs)
     writeGeotransform = writeGeotransform && !dataset->GetGCPCount();
+
+    if (m_WriteRPCTags && m_Imd.Has(MDGeom::RPC))
+      GDALMetadataWriteRPC(dataset);
   }
 
   /* -------------------------------------------------------------------- */
@@ -1916,7 +1906,11 @@ void GDALImageIO::ImportMetadata()
   ImageMetadataBase::Keywordlist kwl;
   GDALMetadataToKeywordlist(m_Dataset->GetDataSet()->GetMetadata(), kwl);
 
-  // Decode SAR metadata
+  // Decode RPC model
+if (m_Dataset->GetDataSet()->GetMetadata("RPC"))
+    GDALMetadataReadRPC();
+
+  // Decode SAR model
   if (kwl.find("SAR") != kwl.end())
   {
     try
@@ -1935,7 +1929,7 @@ void GDALImageIO::ImportMetadata()
     }
   }
 
-  // Decode SAR metadata
+  // Decode SAR calibration data
   if (kwl.find("SARCalib") != kwl.end())
   {
     try
@@ -2006,46 +2000,80 @@ void GDALImageIO::GDALMetadataToKeywordlist(const char* const* metadataList, Ima
       if((fieldName.size() > 36) && (fieldName.substr(0, 36) == "MDGeomNames[MDGeom::SensorGeometry]."))
       {
         // Sensor Geometry is imported directly in the ImageMetadata.
-        // TODO: Keys Starting with: MDGeomNames[MDGeom::SensorGeometry] + '.' should
-        // be decoded by the (future) SensorModelFactory.
       }
-      else if (fieldName == MetaData::MDGeomNames.left.at(MDGeom::RPC))
+      else
       {
-        // RPC Models are imported directly in the ImageMetadata.
-        Projection::RPCParam rpcStruct;
-        rpcStruct.LineOffset    = this->GetAs<double>("RPC/LINE_OFF");
-        rpcStruct.SampleOffset  = this->GetAs<double>("RPC/SAMP_OFF");
-        rpcStruct.LatOffset     = this->GetAs<double>("RPC/LAT_OFF");
-        rpcStruct.LonOffset     = this->GetAs<double>("RPC/LONG_OFF");
-        rpcStruct.HeightOffset  = this->GetAs<double>("RPC/HEIGHT_OFF");
+        kwl.emplace(fieldName, fieldValue);
+      }
+    }
+}
 
-        rpcStruct.LineScale    = this->GetAs<double>("RPC/LINE_SCALE");
-        rpcStruct.SampleScale  = this->GetAs<double>("RPC/SAMP_SCALE");
-        rpcStruct.LatScale     = this->GetAs<double>("RPC/LAT_SCALE");
-        rpcStruct.LonScale     = this->GetAs<double>("RPC/LONG_SCALE");
-        rpcStruct.HeightScale  = this->GetAs<double>("RPC/HEIGHT_SCALE");
+void GDALImageIO::GDALMetadataReadRPC()
+{
+    // RPC Models are imported directly in the ImageMetadata.
+    Projection::RPCParam rpcStruct;
+    rpcStruct.LineOffset    = this->GetAs<double>("RPC/LINE_OFF");
+    rpcStruct.SampleOffset  = this->GetAs<double>("RPC/SAMP_OFF");
+    rpcStruct.LatOffset     = this->GetAs<double>("RPC/LAT_OFF");
+    rpcStruct.LonOffset     = this->GetAs<double>("RPC/LONG_OFF");
+    rpcStruct.HeightOffset  = this->GetAs<double>("RPC/HEIGHT_OFF");
 
-        std::vector<double> coeffs(20);
+    rpcStruct.LineScale    = this->GetAs<double>("RPC/LINE_SCALE");
+    rpcStruct.SampleScale  = this->GetAs<double>("RPC/SAMP_SCALE");
+    rpcStruct.LatScale     = this->GetAs<double>("RPC/LAT_SCALE");
+    rpcStruct.LonScale     = this->GetAs<double>("RPC/LONG_SCALE");
+    rpcStruct.HeightScale  = this->GetAs<double>("RPC/HEIGHT_SCALE");
 
-        coeffs = this->GetAsVector<double>("RPC/LINE_NUM_COEFF",' ',20);
-        std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineNum);
+    std::vector<double> coeffs(20);
 
-        coeffs = this->GetAsVector<double>("RPC/LINE_DEN_COEFF",' ',20);
-        std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineDen);
+    coeffs = this->GetAsVector<double>("RPC/LINE_NUM_COEFF",' ',20);
+    std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineNum);
 
-        coeffs = this->GetAsVector<double>("RPC/SAMP_NUM_COEFF",' ',20);
-        std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleNum);
+    coeffs = this->GetAsVector<double>("RPC/LINE_DEN_COEFF",' ',20);
+    std::copy(coeffs.begin(), coeffs.end(), rpcStruct.LineDen);
 
-        coeffs = this->GetAsVector<double>("RPC/SAMP_DEN_COEFF",' ',20);
-        std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleDen);
+    coeffs = this->GetAsVector<double>("RPC/SAMP_NUM_COEFF",' ',20);
+    std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleNum);
 
-        m_Imd.Add(MDGeom::RPC, rpcStruct);
-      }
-      else
-      {
-        kwl.emplace(fieldName, fieldValue);
-      }
-    }
+    coeffs = this->GetAsVector<double>("RPC/SAMP_DEN_COEFF",' ',20);
+    std::copy(coeffs.begin(), coeffs.end(), rpcStruct.SampleDen);
+
+    m_Imd.Add(MDGeom::RPC, rpcStruct);
+}
+
+void GDALImageIO::GDALMetadataWriteRPC(GDALDataset* dataset)
+{
+  assert(m_Imd.Has(MDGeom::RPC));
+  const Projection::RPCParam & rpc = boost::any_cast<const Projection::RPCParam&>(m_Imd[MDGeom::RPC]);
+  otbLogMacro(Debug, << "Saving RPC to file (" << m_FileName << ")")
+  GDALRPCInfo gdalRpcStruct;
+  gdalRpcStruct.dfSAMP_OFF     = rpc.SampleOffset;
+  gdalRpcStruct.dfLINE_OFF     = rpc.LineOffset;
+  gdalRpcStruct.dfSAMP_SCALE   = rpc.SampleScale;
+  gdalRpcStruct.dfLINE_SCALE   = rpc.LineScale;
+  gdalRpcStruct.dfLAT_OFF      = rpc.LatOffset;
+  gdalRpcStruct.dfLONG_OFF     = rpc.LonOffset;
+  gdalRpcStruct.dfHEIGHT_OFF   = rpc.HeightOffset;
+  gdalRpcStruct.dfLAT_SCALE    = rpc.LatScale;
+  gdalRpcStruct.dfLONG_SCALE   = rpc.LonScale;
+  gdalRpcStruct.dfHEIGHT_SCALE = rpc.HeightScale;
+
+  auto copy_tab = [](auto const& in, auto & out) {
+      auto in_size = getsize_tabs(in, out);
+      // With C++17, use std::size()
+      // auto in_size = std::size(in);
+      // auto out_size = std::size(out);
+      // static_assert(in_size == out_size, "Sizes mismatch!");
+      std::copy_n(std::begin(in), in_size, std::begin(out));
+  };
+  copy_tab(rpc.LineNum, gdalRpcStruct.adfLINE_NUM_COEFF);
+  copy_tab(rpc.LineDen, gdalRpcStruct.adfLINE_DEN_COEFF);
+  copy_tab(rpc.SampleNum, gdalRpcStruct.adfSAMP_NUM_COEFF);
+  copy_tab(rpc.SampleDen, gdalRpcStruct.adfSAMP_DEN_COEFF);
+
+  char** rpcMetadata = RPCInfoToMD(&gdalRpcStruct);
+  dataset->SetMetadata(rpcMetadata, "RPC");
+  CSLDestroy(rpcMetadata);
 }
 
 


=====================================
Modules/IO/IOGDAL/test/CMakeLists.txt
=====================================
@@ -604,6 +604,8 @@ otb_add_test(NAME ioTvGDALRPCTransformerTest_worldview2
   0.1 # ImgTol
   )
 
+#For issue 2293, we had to regenerate the baseline pleaides-1.geom because there was a shift
+#in the geom generated with OTB 7.4, the baseline was wrong. To keep the compatibility, we added this shift in the tests
 otb_add_test(NAME ioTvGDALRPCTransformerTest_pl_hnord_geom
   COMMAND otbIOGDALTestDriver
   otbGDALRPCTransformerTest2
@@ -611,8 +613,13 @@ otb_add_test(NAME ioTvGDALRPCTransformerTest_pl_hnord_geom
   ${INPUTDATA}/pleiades/pleiades-1.gcp2 # GCP
   0.02 # GeoTol
   0.1 # ImgTol
+  0.5 # lineOffset
+  0.5 # sampleOffset
   )
 
+#For issue 2293, we had to regenerate the baseline pleiades-1.gcp2 because there was a shift
+#in the gcps that was fixed by the MR 918
+#To regenerate the gcps, see the wiki on the gitlab
 otb_add_test(NAME ioTvGDALRPCTransformerTest_pl_hnord_product
   COMMAND otbIOGDALTestDriver
   otbGDALRPCTransformerTest2


=====================================
Modules/IO/IOGDAL/test/otbGDALRPCTransformerTest2.cxx
=====================================
@@ -36,7 +36,7 @@ typedef std::vector<itk::Point<double, 3>> pointsContainerType;
 typedef itk::Statistics::EuclideanDistanceMetric<otb::GDALRPCTransformer::PointType> DistanceType;
 typedef otb::GeographicalDistance<otb::GDALRPCTransformer::PointType> GeographicalDistanceType;
 
-int otbGDALRPCTransformerTest2(int itkNotUsed(argc), char* argv[])
+int otbGDALRPCTransformerTest2(int argc, char* argv[])
 {
   bool success = true;
   otb::GDALRPCTransformer::PointType imagePoint;
@@ -47,6 +47,14 @@ int otbGDALRPCTransformerTest2(int itkNotUsed(argc), char* argv[])
   std::string gcpFileName(argv[2]);
   double geoTol(atof(argv[3]));
   double imgTol(atof(argv[4]));
+  double lineOffset(0);
+  double sampleOffset(0);
+
+  if(argc == 7)
+  {
+    lineOffset = atof(argv[5]);
+    sampleOffset = atof(argv[6]);
+  }
 
   // Tools
   auto distance = DistanceType::New();
@@ -60,7 +68,7 @@ int otbGDALRPCTransformerTest2(int itkNotUsed(argc), char* argv[])
     for (int loop = 0 ; loop < geomSupplier.GetNbBands() ; ++loop)
       imd.Bands.emplace_back();
     otb::ImageMetadataInterfaceFactory::CreateIMI(imd, geomSupplier);
-    geomSupplier.FetchRPC(imd);
+    geomSupplier.FetchRPC(imd, lineOffset, sampleOffset);
   }
   else
   {


=====================================
Modules/IO/ImageIO/include/otbImageFileReader.hxx
=====================================
@@ -403,7 +403,10 @@ void ImageFileReader<TOutputImage, ConvertPixelTraits>::GenerateOutputInformatio
   {
     GeomMetadataSupplier geomSupplier(m_FilenameHelper->GetExtGEOMFileName(), m_FileName);
     ImageMetadataInterfaceFactory::CreateIMI(imd, geomSupplier);
-    geomSupplier.FetchRPC(imd);
+    if(imd.Has(MDStr::Mission) && (imd[MDStr::Mission] == "Pléiades"))
+      geomSupplier.FetchRPC(imd, 0.5, 0.5);
+    else
+      geomSupplier.FetchRPC(imd);
     geomSupplier.FetchGCP(imd);
     otbLogMacro(Info, << "Loading metadata from external geom file " << m_FilenameHelper->GetExtGEOMFileName());
   }


=====================================
Modules/Wrappers/ApplicationEngine/include/otbWrapperListViewParameter.h
=====================================
@@ -173,7 +173,7 @@ public:
 
   void FromString(const std::string& value) override
   {
-    SetValue(value);
+    SetSelectedNames({value});
   }
 
   std::vector<std::string> ToStringList() const override


=====================================
Modules/Wrappers/SWIG/src/otbApplication.i
=====================================
@@ -614,25 +614,37 @@ class ApplicationProxy(object):
                        ParameterType_OutputFilename,
                        ParameterType_Directory, ParameterType_InputImage,
                        ParameterType_InputVectorData]:
+        if not isinstance(value, str):
+          raise TypeError("Expected a string for '%s' parameter in %s, got %s for %s" % (paramKey, self.GetName(), type(value), value))
         return self.SetParameterString(paramKey, value)
       elif paramType in [ParameterType_InputImageList, ParameterType_InputVectorDataList,
                          ParameterType_InputFilenameList, ParameterType_StringList,
                          ParameterType_ListView, ParameterType_Field, ParameterType_Band]:
+        if not isinstance(value, list):
+          raise TypeError("Expected a list for '%s' parameter in %s, got %s for %s" % (paramKey, self.GetName(), type(value), value))
         return self.SetParameterStringList(paramKey, value)
       elif paramType in [ParameterType_Int, ParameterType_Radius, ParameterType_RAM]:
+        if not isinstance(value, int):
+          raise TypeError("Expected an int for '%s' parameter in %s, got %s for %s" % (paramKey, self.GetName(), type(value), value))
         return self.SetParameterInt(paramKey, value)
       elif paramType in [ParameterType_Float]:
+        if not isinstance(value, (int, float)):
+          raise TypeError("Expected a float for '%s' parameter in %s, got %s for %s" % (paramKey, self.GetName(), type(value), value))
         return self.SetParameterFloat(paramKey, value)
       elif paramType in [ParameterType_Double]:
+        if not isinstance(value, (int, float)):
+          raise TypeError("Expected a float for '%s' parameter in %s, got %s for %s" % (paramKey, self.GetName(), type(value), value))
         return self.SetParameterDouble(paramKey, value)
       elif paramType in [ParameterType_Bool]:
+        if not isinstance(value, bool):
+          raise TypeError("Expected a bool for '%s' parameter in %s, got %s for %s" % (paramKey, self.GetName(), type(value), value))
         return self.SetParameterString(paramKey, str(value) )
       elif paramType in [ParameterType_Group]:
         return ApplicationProxy(self, paramKey)
       elif paramType in [ParameterType_Choice]:
         return ApplicationProxy(self, paramKey, value)
       else:
-        print ("Unsupported parameter type '%s' with key '%s'" %(self.GetParameterTypeAsString(paramType) ,paramKey))
+        print ("Unsupported parameter type '%s' with key '%s'" %(self.GetParameterTypeAsString(paramType), paramKey))
       return
 
     def GetParameters(self):


=====================================
RELEASE_NOTES.txt
=====================================
@@ -1,3 +1,28 @@
+OTB-v 8.1.0 - Changes since version 8.0.1 (August 11th, 2022)
+---------------------------------------------------------------------
+
+Features added:
+
+   * !917: Avoid reloading the same DEM directory by Julien Osman
+   * !904: Add default radius value to NewFunctorFilter overload by Laurențiu Nicola
+
+Bugs fixed:
+
+   * !922: Fix strange behavior of BandMath in python pipeline by calling RegisterPipeline() by Rémi Cresson
+   * !920: Correctly take into account the extended filename writerpctag by Julien Osman
+   * !918: Fix Pixel shift in pleiades orthorectification by Thibaut ROMAIN
+   * !914: Read RPC model from images writen by OTB by Julien Osman
+   * !879: Fix SetParameterString for listview parameters by Cédric Traizet
+
+Documentation:
+
+   * !889: HaralickTextureExtraction: Clarify the definition of the parameters xrad and yrad by Julien Osman
+   * !887: Improve Python errors of mismatched types by Luc Hermitte
+
+Licence and legislation matters:
+
+   * !905: Remove the 'Lena' image by Julien Osman
+
 OTB-v 8.0.1 - Changes since version 8.0.0 (April 27th, 2022)
 ---------------------------------------------------------------------
 
@@ -105,6 +130,13 @@ Documentation:
    * !780: Updating the documentation in preparation for OTB 8.0.0-alpha1 by Julien Osman
    
 
+OTB-v 7.4.1 - Changes since version 7.4.0 (April 27th, 2022)
+----------------------------------------------------------------
+
+Features added:
+
+   * Update DiapOTB to v1.1.0
+
 OTB-v 7.4.0 - Changes since version 7.3.0 (September 3rd, 2021)
 ----------------------------------------------------------------
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/-/commit/e992e618b3d57c5d944ef1e78c9909729a1bf788

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/otb/-/commit/e992e618b3d57c5d944ef1e78c9909729a1bf788
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220811/b41b114f/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list