Requests for Comments-9: Improve otb::DEMHandler interface to edit DEM-directory and Geoid-file

From OTBWiki
Jump to: navigation, search


  • Submitted by Stéphane ALBERT (CS-SI) on 17/09/2015
  • Development done on OTB and Monteverdi2 DEMHandler_clear feature-branches:
  1.; and
  • References:


What changes will be made and why they will make a better Orfeo ToolBox

otb::DEMHandler is a singleton class which allow client code to the OTB library to ::OpenDEMDirectory() and/or ::OpenGeoidFile() but not to clear them, nor clear and setup again nor can it be deleted and set up again (because it is a singleton class). Currently the otb::DEMHandler can be used in programs which set it up once and run. But, higher level applications such as, for example, GUI applications and, in particular, Monteverdi2, need to set the otb::DEMHandler at initialization time and then allow the user to enable/edit the DEM-directory and Geoid-file.

When ::OpenDEMDirectory() is called, each file of the directory is loaded into the ossimElevManager as an ossimElevDatabase:

  1. Add a ::ClearDEMs() method to clear the ossimElevManager;
  2. Add a ::GetDEMCount() to return the number of ossimElevDatabases contained within the ossimElevManager so the client program can iterate through the DEMs;
  3. (optional) Rename method ::GetDEMDirectory( unsigned int ) method to GetDEM( unsigned int ).

When ::OpenGeoidFile() is called, an EGM96 Geoid-file is added once (and only once) into the ossimGeoidManager which can contain several ones but does not provide a clearing interface such as the ossimElevManager:

  1. Modifiy ::OpenGeoidFile() to return a boolean value informing whether the Geoid-file has been registered into the ossimGeoiManager (so, the client application can react to);
  2. Throw an exception when the Geoid-file has not been correctly loaded so the client program could display an error message.
When will those changes be available (target release or date)

Available on feature branch DEMHandler_clear (see and