NOAA-OCM / QNSPECT

QGIS Plugin for NOAA Nonpoint Source Pollution and Erosion Comparison Tool (NSPECT)
GNU General Public License v2.0
7 stars 5 forks source link

GDAL Raster Calculator unable to write files if open in another program. #38

Open ar-siddiqui opened 2 years ago

ar-siddiqui commented 2 years ago

When overwriting the output file, this is what is happening in different QGIS versions and different use cases. In most cases, data is successfully processed despite messages. Although sometimes you have to refresh the map to see changes.

Case 3.16.5 3.22.2
Output file not loaded in canvas but exist ERROR 1: C:\Users\asiddiqui\Desktop\plugin_test\Runoff Local.tif, band 1: Write operation not permitted on dataset opened in read-only mode 0.. Block writing failed No Error Message
Output file loaded in canvas ERROR 1: C:\Users\asiddiqui\Desktop\plugin_test\Runoff Local.tif, band 1: Write operation not permitted on dataset opened in read-only mode 0.. Block writing failed [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\asiddiqui\Desktop\plugin_test8\Runoff Local.tif' Process returned error code 0

A ticket has been filed with QGIS https://github.com/qgis/QGIS/issues/47233

ar-siddiqui commented 2 years ago

If this is a major issue, we may have to remove all outputs from the existing QGIS project and then write.

ar-siddiqui commented 2 years ago

Refer #47 for temporary solution

ar-siddiqui commented 2 years ago

One possible solution is to use the QGIS Native Raster calculator.