2

I am working on QGIS 3.26.3-Buenos Aires on Windows 10 and just realised that it has two different raster calculators. I believe they are both from the standard version, no plug-in. They have different UI and give different results. Why is it the case ?

The first raster calculator (1) is accessible via the Menu > Raster > Raster Calculator:

enter image description here

I found the other one (2) via the toolbox, Raster Analysis > Raster Calculator:

enter image description here

I used both calculator to perform a simple addition on the same layer, but the results are different! See image below. "downstream_topotoR_5m_wgs84@1"+42.727 is from the menu calculator (1) and Output is from the toolbox calculator (2).

enter image description here

I noticed that the original raster file I am working with is Float32 type with -3.40282e+38 as No-Data. So is Output, but "downstream_topotoR_5m_wgs84@1"+42.727 is Float64 and has n-a as No_Data. This is probably where the difference is but I do not understand how this affects the data. Also, I didn't see any options for that in any of the raster calculators.

6
  • 1
    So only no data cells are affected? The cells containing data result in the same output? In fact, there must also be a 3rd Raster calculator: QGIS native, GDAL and SAGA: gis.stackexchange.com/a/414826/88814
    – Babel
    Commented May 8, 2023 at 18:41
  • And even a 4th: GRASS Mapcalc: docs.qgis.org/3.28/en/docs/training_manual/grass/…
    – Babel
    Commented May 8, 2023 at 18:48
  • 1
    With a look at your screenshots: both show the QGIS native Raster calculator, seem just to be different versions. The Toolbox is just the place where you find all algorithms and tools you can access on QGIS in the same place. Some also appear in the menus, others not
    – Babel
    Commented May 8, 2023 at 18:56
  • Thank you for these comments. Indeed it looks like two different versions. The one that can be found in the menu seems to be the latest one (with the IF statement) but also the one that messes up no-data cells and change the original format. I will get the latest QGIS version and check again.
    – tukanium
    Commented May 8, 2023 at 19:33
  • 1
    It is the same in the QGIS 3.30.2 and to me it is a bug. The raster menu's calculator uses Foat64 and doesn't recognise -3.40282e+38 as no-data value. See github.com/qgis/QGIS/issues/47812.
    – tukanium
    Commented May 8, 2023 at 20:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.