Commit 902b43d6 authored by Cédric Traizet's avatar Cédric Traizet

ENH: code review

parent 9f3fe8e6
Pipeline #5648 passed with stages
in 121 minutes and 4 seconds
......@@ -324,7 +324,7 @@ bool DEMHandler::IsValidDEMDirectory(const std::string& DEMDirectory) const
for (const auto & filename : DEMDetails::GetFilesInDirectory(DEMDirectory))
{
// test if a driver can identify this dataset
auto identifyDriverH = static_cast<GDALDriver *>(GDALIdentifyDriver(filename.c_str(), nullptr));
auto identifyDriverH = GDALIdentifyDriver(filename.c_str(), nullptr);
if (identifyDriverH)
{
return true;
......@@ -338,12 +338,14 @@ std::string DEMHandler::GetDEMDirectory(unsigned int idx) const
{
if (idx >= m_DEMDirectories.size())
{
return "";
}
else
{
return m_DEMDirectories[idx];
std::ostringstream oss;
oss << "Requested DEM diectory " << idx
<< ", but only "<< m_DEMDirectories.size() << "have been set.";
throw std::out_of_range (oss.str());
}
return m_DEMDirectories[idx];
}
std::string DEMHandler::GetGeoidFile() const
......
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