DEM file reader from C++ version