diff --git a/src/avalanche/gistools/gridfile.C b/src/avalanche/gistools/gridfile.C index 0b77d9809e736672050024e378ef1d72fdec005e..a6e59b270729e62f8b74023d29b29b9464d0e52a 100644 --- a/src/avalanche/gistools/gridfile.C +++ b/src/avalanche/gistools/gridfile.C @@ -34,6 +34,7 @@ Author #include <sstream> #include <limits> #include <cmath> +#include <algorithm> // Debugging output #undef DebugInfo @@ -166,6 +167,12 @@ int gridfile::read(const std::string& fname) { std::getline(pFile, line); + std::transform(line.begin(), line.end(), line.begin(), + [](unsigned char c){ return std::tolower(c); } + ); //https://en.cppreference.com/w/cpp/string/byte/tolower + + DebugInfo << "line=" << line << std::endl; + std::string::size_type i = std::string::npos; if ((i = line.find("ncols")) != std::string::npos) @@ -207,7 +214,7 @@ int gridfile::read(const std::string& fname) { this->dy_ = std::stod(line.substr(i + 2)); } - else if ((i = line.find("NODATA_value")) != std::string::npos) + else if ((i = line.find("nodata_value")) != std::string::npos) { this->NODATA_value_ = std::stod(line.substr(i + 12)); readheader = false;