Deltares / imod-qgis

🗺️🧭 QGIS plugin for iMOD
GNU General Public License v2.0
7 stars 1 forks source link

IDF conversion fails silently if there is no write permission #51

Closed Huite closed 6 months ago

Huite commented 12 months ago

When opening an IDF, it is converted to an equivalent geotiff file, which is written next to the IDF.

However, if the user does not have writing permission, GDAL will fail silently (since the Python bindings of GDAL do not raise exceptions). Then the raster type will be None, and setGeoTransform will fail instead, which is a very confusing error message.

What we should do instead, I think, is check whether GDAL has not failed, then raise that specific error ("IDF could not be converted to GeoTIFF"), which is probably still general, but less cryptic than "NoneType has no attribute setGeoTransform".

JoerivanEngelen commented 6 months ago

Duplicate from https://github.com/Deltares/imod-qgis/issues/67