Commit b71ab48c authored by Julien Osman's avatar Julien Osman
Browse files

ENH: Avoid reloading the same DEM directory

parent b7f91e5b
Pipeline #10851 failed with stages
in 108 minutes and 52 seconds
......@@ -211,6 +211,16 @@ void DEMHandler::OpenDEMFile(const std::string& path)
void DEMHandler::OpenDEMDirectory(const std::string& DEMDirectory)
{
auto isSameDirectory = [DEMDirectory](std::string s)
{
return s == DEMDirectory;
};
if(std::any_of(std::begin(m_DEMDirectories), std::end(m_DEMDirectories), isSameDirectory))
{
otbLogMacro(Info, << "Directory '"<< DEMDirectory << "' already opened.")
return;
}
// Free the previous in-memory dataset (if any)
if (!m_DatasetList.empty())
VSIUnlink(DEM_DATASET_PATH.c_str());
......
Supports Markdown
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