Request for Changes-2: Improve otb::DEMHandler interface to edit DEM-directory and Geoid-file
Contents
Status
- Author: Stéphane ALBERT (CS-SI)
- Additional Contributors: none
- Submitted on: 17/09/2015
- Proposed target release:
- Adopted (+4 from Jordi, Manuel, Julien, Rémi)
- Merged at http://git.orfeo-toolbox.org/otb.git/commit/27efb1cc71bdec877513417a07c70a2a1714f822
- Link:
- http://git.orfeo-toolbox.org/otb.git/shortlog/refs/heads/DEMHandler_clear; and
- http://git.orfeo-toolbox.org/monteverdi2.git/shortlog/refs/heads/DEMHandler_clear
References:
Summary
Improve the otb::DEMHandler
singleton class to provide a clearing interface to DEM-directory and Geoid-file management so that client code to the OTB can edit the instance after having set it up for the first time.
Rationale
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 singleton-class status). 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, Monteverdi, need to set the otb::DEMHandler
at initialization time and then allow the user to enable/edit the DEM-directory and Geoid-file.
Implementation details
Classes and files
When ::OpenDEMDirectory()
is called, each file of the directory is loaded into the ossimElevManager
as an ossimElevDatabase
:
- Add a
::ClearDEMs()
method to clear theossimElevManager
; - Add a
::GetDEMCount()
to return the number ofossimElevDatabase
s contained within theossimElevManager
so the client program can iterate through the DEMs; - (optional) Rename method
::GetDEMDirectory( unsigned int )
method toGetDEM( 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
:
- Modifiy
::OpenGeoidFile()
to return a boolean value informing whether the Geoid-file has been registered into theossimGeoiManager
(so, the client application can react to); - Throw an exception when the Geoid-file has not been correctly loaded so the client program could display an error message.
Applications
N.A.
Tests
- Tests based on
otb::DEMHandlerTest
, especially uaTvDEMHandler_AboveEllipsoid_SRTM_BadGeoid
Documentation
Improved documentation of following otb::DEMHandler
methods:
-
otb::DEMHandler::ClearDEMs()
-
otb::DEMHandler::GetDEMCount()
-
otb::DEMHandler::OpenDEMDirectory()
-
otb::DEMHandler::OpenGeoidFile()
Additional notes
N.A.