I have been trying to create an .asc file that contains the difference between two others. This can be represented as C=A-B. All files have the same size.

When using the Raster Calculator built into QGIS 3.4.7 there is no option to output to an .asc file. This would have been my preferred option.

After some research, I found the other raster calculator in the toolbox. This was far more complicated to use, though the options were there. However when attempting to run the file, it consistently failed. From what I saw in the code, it was unable to find the function GetGeoTransform() (and related functions) within gdal_calc.py file. It was here I hit a dead end.

So, as I am still unfamiliar with QGIS, can I have some advice on how I can achieve this, or what other file type I should be using?

The reason I wanted to use .asc files was because they are the file type I most commonly receive, and can be opened in a text file which allows quick identification of grid size, extents and accuracy of data (ie was the data rounded).

Edit/Update: I have found a way to do it. First I use the Raster Calculator from Raster->Raster calculator to compare the asc files. I out put this as a GeoPackage file (.GPKG). I can then convert this using the Function Raster->Conversion->Translate (convert format) to convert to an .asc file

  • I think you could do this procedure using SAGA-GIS tools - first the grid calculation and then export to Esri Ascii grid. But I am not sure if this can be done from QGIS as I prefer to use SAGA separately and then load the results in QGIS. – Juhele Jun 19 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.