Bug report #18764

Raster calculator (native and SAGA) not usable in Processing Modeller

Added by matteo ghetta over 2 years ago. Updated about 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Processing/Modeller
Affected QGIS version:master Regression?:No
Operating System:any Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:26651

Description

While both raster calculators works fine when used in Processing, within a modeler both fail even with one single layer and a simple formula (dtm > 500). With the same layer and same formula no problem in Processing.

1. native raster calculator: produces the output, but with useless values (both min and max values = 1.79769e+308)
2. Saga raster calculator: if no additional layers are set (even if optional) the error is the same as #18751. If an additional layer is set (even the same used for the calculation), no outputs are produced and this is the error of the Log:

Processing algorithm…
AlgorithmDialog
Input parameters:
{ 'dtm' : '/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif', 'saga:rastercalculator_1:fine' : '/tmp/processing_5f46799de95842c3b83d730a42e75fd8/3e383b4414fd4461be11722cd574876c/saga_rastercalculator_1_fine.tif' }

Prepare algorithm: saga:rastercalculator_1
Running Raster calculator [1/1]
Input Parameters:
{ FORMULA: 'a > 500', GRIDS: '/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif', RESAMPLING: 3, RESULT: '/tmp/processing_5f46799de95842c3b83d730a42e75fd8/3e383b4414fd4461be11722cd574876c/saga_rastercalculator_1_fine.tif', TYPE: 7, USE_NODATA: False, XGRIDS: ['/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif'] }
io_gdal 0 -TRANSFORM 1 -RESAMPLING 3 -GRIDS "/tmp/processing_5f46799de95842c3b83d730a42e75fd8/c7d6d327d749453fb9b0ae4459f0a087/dtm.sgrd" -FILES "/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif" 
io_gdal 0 -TRANSFORM 1 -RESAMPLING 3 -GRIDS "/tmp/processing_5f46799de95842c3b83d730a42e75fd8/89db7c096ffd4c92a483c61f1a6672d3/dtm.sgrd" -FILES "/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif" 
grid_calculus "Grid Calculator" -GRIDS "/tmp/processing_5f46799de95842c3b83d730a42e75fd8/c7d6d327d749453fb9b0ae4459f0a087/dtm.sgrd" -XGRIDS "/tmp/processing_5f46799de95842c3b83d730a42e75fd8/89db7c096ffd4c92a483c61f1a6672d3/dtm.sgrd" -FORMULA "a > 500" -RESAMPLING 3 -USE_NODATA false -TYPE 7 -RESULT "/tmp/processing_5f46799de95842c3b83d730a42e75fd8/3e383b4414fd4461be11722cd574876c/saga_rastercalculator_1_fine.tif" 
____________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
____________________________

SAGA Version: 2.3.1

____________________________
library path: /usr/lib/x86_64-linux-gnu/saga/
library name: libio_gdal
library : GDAL/OGR
tool : Import Raster
author : O.Conrad (c) 2007 (A.Ringeler)
processors : 4 [4]
____________________________

Parameters

Grids: No objects
Files: "/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif" 
Select from Multiple Bands:
Alphanumeric Sorting: yes
Transformation: yes
Resampling: B-Spline Interpolation

loading: /home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif

Driver: GTiff

Bands: 1

Rows: 2170

Columns: 2465

loading: dtm

____________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
____________________________

SAGA Version: 2.3.1

____________________________
library path: /usr/lib/x86_64-linux-gnu/saga/
library name: libio_gdal
library : GDAL/OGR
tool : Import Raster
author : O.Conrad (c) 2007 (A.Ringeler)
processors : 4 [4]
____________________________

Parameters

Grids: No objects
Files: "/home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif" 
Select from Multiple Bands:
Alphanumeric Sorting: yes
Transformation: yes
Resampling: B-Spline Interpolation

loading: /home/matteo/lavori/corsi/QGIS/piemonte/QGIS_data/dtm.tif

Driver: GTiff

Bands: 1

Rows: 2170

Columns: 2465

loading: dtm

____________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
____________________________

SAGA Version: 2.3.1

____________________________
library path: /usr/lib/x86_64-linux-gnu/saga/
library name: libgrid_calculus
library : Calculus
tool : Grid Calculator
author : A.Ringeler (c) 2003
processors : 4 [4]
____________________________

Load grid: /tmp/processing_5f46799de95842c3b83d730a42e75fd8/c7d6d327d749453fb9b0ae4459f0a087/dtm.sgrd...

Load grid: /tmp/processing_5f46799de95842c3b83d730a42e75fd8/89db7c096ffd4c92a483c61f1a6672d3/dtm.sgrd...

Parameters

Grid system: 100; 2170x 2465y; 1554797.231034x 4678370.770000y
Grids: 1 object (dtm)
Grids from different Systems: 1 object (dtm)
Resampling: B-Spline Interpolation
Result: Result
Formula: a > 500
Name: Calculation
Take Formula: no
Use NoData: no
Data Type: 4 byte floating point number

Warning: The number of supplied grids exceeds the number of variables in formula. (2 > 1)

OK. Execution took 28.326 s (1 outputs).
Model processed OK. Executed 1 algorithms total in 28.499 s.
Execution completed in 28.61 seconds
Results:
{'saga:rastercalculator_1:fine': '/tmp/processing_5f46799de95842c3b83d730a42e75fd8/3e383b4414fd4461be11722cd574876c/saga_rastercalculator_1_fine.tif'}

Loading resulting layers
The following layers were not correctly generated.
/tmp/processing_5f46799de95842c3b83d730a42e75fd8/3e383b4414fd4461be11722cd574876c/saga_rastercalculator_1_fine.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

History

#1 Updated by Nyall Dawson about 2 years ago

  • Status changed from Open to Feedback

This is fixed in master, right?

#2 Updated by matteo ghetta about 2 years ago

  • Status changed from Feedback to Closed

yep, both native and saga are working in the modeler. Thanks

#3 Updated by Giovanni Manghi about 2 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF