diff --git a/Modules/Adapters/OSSIMAdapters/include/otbDEMHandler.h b/Modules/Adapters/OSSIMAdapters/include/otbDEMHandler.h index 75ee3e8820d7b86208fcd655f088691cabb6ea55..fbc36ea41712c1545b93e364ddfc16c27d0a4d05 100644 --- a/Modules/Adapters/OSSIMAdapters/include/otbDEMHandler.h +++ b/Modules/Adapters/OSSIMAdapters/include/otbDEMHandler.h @@ -108,8 +108,8 @@ public: virtual bool IsValidDEMDirectory(const char* DEMDirectory); /** Open geoid file. */ - virtual void OpenGeoidFile(const char* geoidFile); - virtual void OpenGeoidFile(const std::string& geoidFile); + virtual bool OpenGeoidFile(const char* geoidFile); + virtual bool OpenGeoidFile(const std::string& geoidFile); /** Compute the height above MSL(Mean Sea Level) of a geographic point. */ virtual double GetHeightAboveMSL(double lon, double lat) const; diff --git a/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx b/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx index f5c824bd2ab872b3dd0d41d04b7e1b186859a815..8c2c28fb474f9e3d873d5e4418fa1f1859ca58e3 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbDEMHandler.cxx @@ -126,7 +126,7 @@ DEMHandler return result; } -void +bool DEMHandler ::OpenGeoidFile(const char* geoidFile) { @@ -150,20 +150,27 @@ DEMHandler ossimElevManager::instance()->setDefaultHeightAboveEllipsoid(ossim::nan()); + return true; } else { otbMsgDevMacro(<< "Failure opening geoid"); geoidPtr.release(); + + itkExceptionMacro( << "Failed to open geoid file: '" << geoidFile << "'" ); + + return false; } } + + return false; } -void +bool DEMHandler ::OpenGeoidFile(const std::string& geoidFile) { - OpenGeoidFile(geoidFile.c_str()); + return OpenGeoidFile(geoidFile.c_str()); } double