Skip to content

Release 1.4.0

Cresson Remi requested to merge dev-otbtf into master

This MR is the results of me working with OTBTF, finding new small bugs.
Thus it may contain many heterogeneous fixes. I'll try to link this to issues.

Closes #22 (closed), #23 (closed), #21 (closed), #25 (closed), #26 (closed), #24 (closed), #27 (closed)

Changelog:

  • renamed tools.py to helpers.py since it is more accurate
  • fix logger (avoid getting root logger in current namespace, instead use name 'pyOTB')
  • added helpers.set_logger_level() in order to modify the pyotb logger level after import. regarding OTB, it has to be done with env variables before imports
  • add env variables PYOTB_LOGGER_LEVEL, or use OTB_LOGGER_LEVEL, else use INFO
  • add en variable PYOTB_LOG_FILE to redirect log to file handler
  • fix function find_output for special in-memory cases, or extended filenames
  • raise KeyError with more useful message if a bad kwarg is passed to write()
  • extended filenames
    • better check of extended filename parameter, warning if provided twice (func arg and filename)
    • append gdal:co:BIGTIFF=IF_SAFER to filename when compression is enabled
  • add otbObject attribute output_param to avoid checking if it is an App instance
  • add App private function __save_objects() in order to save parameters as class attributes, during execute() or __init__() when execute is not done during init.
  • refac find_otb()
    • return otbApplication module, or raise SystemExit from EnvironmentError or ImportError
    • add function set_environment(), executed before importing OTB when it is possible (case var OTB_ROOT or scanned system)
    • windows : search for OTB in "c:/Program Files"
    • new OTB install import error : suggest symlink python lib if version is 3.8, or print ctest cmd to recompile SWIG bindings
    • fix directories precedence when multiple versions of OTB are installed
  • in-memory pipelines : enhance execute and write for intermediate outputs (we need to document how to do it since order matters)
    • it is now possible to write pipelines without duplicated execution calls, to achieve that you may pass the output filename directly when creating the app, then just trigger the last app with execute() or write()
    • it is also now possible to pass a pixel_type for outputs during App init
    • App execute argument is now False by default, this affects oneliners, you may need to edit your scripts if they do not use write() or execute() functions (at least once at the end of a pipeline).
Edited by Cresson Remi

Merge request reports