Commit 761da804 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH: don't close old geoid if new one is not valid when setting a geoid in DEMHandler

parent 552d53a6
Pipeline #5623 failed with stages
in 78 minutes and 28 seconds
......@@ -234,15 +234,20 @@ bool DEMHandler::OpenGeoidFile(const std::string& geoidFile)
// TODO : RemoveOSSIM
OssimDEMHandler::Instance()->OpenGeoidFile(geoidFile);
int pbError;
auto ds = GDALOpenVerticalShiftGrid(geoidFile.c_str(), &pbError);
// pbError is set to TRUE if an error happens.
if (pbError == 0)
{
if (m_GeoidDS)
{
GDALClose(m_GeoidDS);
}
int pbError;
m_GeoidDS = static_cast<GDALDataset*>(GDALOpenVerticalShiftGrid(geoidFile.c_str(), &pbError));
m_GeoidDS = static_cast<GDALDataset*>(ds);
m_GeoidFilename = geoidFile;
}
return pbError;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment