Skip to content

Robust extended filename options interpretation

Summary

Closes #2312 (closed)

Rationale

When input file paths are HTTP URIs, like the one we can use with vsicurl, the extended filename options deduction can be a mess. The current implementation only split the filename from the first encountered ? character. This is wrong, since such character can be part of a HTTP request pointing to an online raster file.

Implementation Details

The new implementation consider that the last occurrence of ?& marks the beginning of the extended filename options.

Classes and files
  • ENH: Modules/Core/Common/src/otbExtendedFilenameHelper.cxx (new implementation)
  • REFAC: Modules/IO/ExtendedFilename/src/otbExtendedFilenameToReaderOptions.cxx (shorter code)
  • FIX: some tests contained wrong extended filename pattern (the documentation clearly states the right pattern is Path/Image.ext?&key1=value1&key2=value2).
    • Modules/Adapters/GdalAdapters/test/CMakeLists.txt
    • Modules/IO/ExtendedFilename/test/CMakeLists.txt
    • Modules/IO/ImageIO/test/CMakeLists.txt
    • Modules/Applications/AppSARCalibration/test/CMakeLists.txt
    • Modules/Core/ImageBase/test/CMakeLists.txt

Copyright

The copyright owner is INRAE and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Rémi Cresson

Merge request reports

Loading