Skip to content

Draft: Refac otbObject inheritance

Vincent Delbar requested to merge 37-refac-otbobject-inheritance into develop

Closes #37 (closed) and #44 (closed)

Changelog :

  • output parameter keys and types are stored in object's out_param_keys and out_param_types
  • add properties key_input_image and key_output_image to expose the first parameter key corresponding to image parameter IO (replace old output_param)
  • thanks to key_input_image, it is now possible to pass input file as first argument to an app, even if its name is different than "in" or "il"
  • add function export to export a numpy array, they will be stored in object's exports_dict in order to avoid duplicated ExportImage call
  • it is now possible to pass a key parameter to to_numpy or to_rasterio in order to export another image than the default output param, array objects will be fetch from exports_dict if already exported
  • add OTBObject function flush() in order to separate the write logic (arguments parsing) from the WriteOutput / flush event - should help to avoid duplicated executions
  • add new OTBObject property outputs that returns a list of output param values
  • now that most of the app execution logic has moved to OTBObject, the App class can be extended with functions to improve user experience (like find_output )
  • add function read_values_at_coords to RasterInterface that allow to read a pixel value at coordinates, directly or using index like app[100,100,1]
  • using _set_param or set_parameters with None value or an empty list/tuple now allow to clear a parameter value using app.ClearValue
  • move App and MetaOTBApp related code to apps.py
Edited by Vincent Delbar

Merge request reports