Skip to content
Snippets Groups Projects
Commit 6f46ae0f authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Added bool return value when otb::DEMHandler::OpenGeoidFile() has failed...

ENH: Added bool return value when otb::DEMHandler::OpenGeoidFile() has failed and thrown ITK exception when file could not be properly loaded.
parent 37475323
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment