Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS console: 'saga:rastercalc' giving bogus values compared to other algorithms #20701

Closed
qgib opened this issue Apr 13, 2015 · 4 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Apr 13, 2015

Author Name: paolo prosperi (paolo prosperi)
Original Redmine Issue: 12573
Affected QGIS version: 2.8.1
Redmine category:processing/saga


A note the issue reported under #20615, but mine seems different.
From QGIS python console, saga:rastercalculator gives bogus values compared to QGIS GUI raster calculator(same input rasters and formulas, obviously).

  out = processing.runalg('saga:rastercalculator',A,[B,C],'a*b/c','false',8,None)

Just a double check, I changed algorithm:

  out = processing.runalg('grass:r.mapcalculator',A,B,C,None,None,None,'A*B/C','-180,180,-90,90',0.5,None) 

and got the very same results as in the QGIS GUI raster calculator.

I'm on Windows (tried both 7 and 8.1) with QGIS 2.8.1 Wien (from OSGEO4W).
I'm attaching the input rasters.


@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2015

Author Name: Giovanni Manghi (@gioman)


If is SAGA that makes the wrong calculations then qgis/processing cannot do anything about it. Can you test run the same operation using the SAGA command line/gui? Thanks.


  • status_id was changed from Open to Feedback
  • category_id was configured as Processing/SAGA

@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2015

Author Name: paolo prosperi (paolo prosperi)


I am indeed having the same strange results from SAGA GUI (Grid Calculus command) as I did earlier from saga:rastercalculator in QGIS console. I don't know how to do the same with SAGA command line, sorry.
I am attaching all the results from the different algorithms used.
P


  • 8587 was configured as out_QGISSAGA.tif
  • 8588 was configured as out_SAGAGUI.tif
  • 8586 was configured as out_QGISGUI.tif
  • 8585 was configured as out_QGISGRASS.tif

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2015

Author Name: Giovanni Manghi (@gioman)


paolo prosperi wrote:

I am indeed having the same strange results from SAGA GUI (Grid Calculus command) as I did earlier from saga:rastercalculator in QGIS console. I don't know how to do the same with SAGA command line, sorry.
I am attaching all the results from the different algorithms used.

SAGA gui or cli does not make difference, but if this is a SAGA issue than we cannot do anything in QGIS/Processing.


  • resolution was changed from to up/downstream
  • status_id was changed from Feedback to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2015

Author Name: paolo prosperi (paolo prosperi)


Following Giovanni's response, I filed a bug in the SAGA system and, very surprisingly, this is the outcome from Olaf Conrad (http://sourceforge.net/p/saga-gis/bugs/204/):

"This is not a bug but a feature. If using grids with different grid systems, values are interpolated automatically with a spline function to meet the target grid system.
For convenience I just added an option that allows you to choose another interpolation type. Now you can choose 'nearest neighbour', if you want to reproduce the exact grass map calculator results. Alternatively resample your grids to one single grid system without interpolation (i.e. nearest neighbour) and use these with SAGA's grid calculator. Thank you for pointing at this inflexibility."

Good to know for anyone working with saga:rastercalculator tool in QGIS.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant