Bug report #10463

Reclassify grid values - SAGA 2.1.2 has a new parameter

Added by Pedro Venâncio over 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18875

Description

Reclassify grid values with SAGA 2.1.2 gives error, because this version has 2 new parameters:

http://sourceforge.net/apps/trac/saga-gis/attachment/wiki/Changelog%202.1.2/changelog_saga_2.1.2.txt
r1984 | reklov_w | Reclassify Grid Values: add new option to allow the assignment of a user defined NoData value to the output dataset

Algorithm Reclassify grid values starting...
grid_tools "Reclassify Grid Values" -INPUT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\6e0fb1fd5ab0411a8b713cc62707d301\\aa2003.sgrd" -METHOD 0 -OLD 1 -NEW 1 -SOPERATOR 0 -MIN 0 -MAX 1 -RNEW 2 -ROPERATOR 0 -RETAB "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\1401897077.515.txt" -TOPERATOR 0 -NODATAOPT -NODATA 0 -OTHEROPT -OTHERS 0 -RESULT "D:/EUQ2014/Dados/resultados_3/aa_2003_teste.tif.sgrd" 
io_gdal 1 -GRIDS "D:/EUQ2014/Dados/resultados_3/aa_2003_teste.tif.sgrd" -FORMAT 4 -TYPE 0 -FILE "D:/EUQ2014/Dados/resultados_3/aa_2003_teste.tif" 

C:\\PROGRA~1\\QGISVA~1\\bin>set SAGA=C:\\saga_2.1.2_x64

C:\\PROGRA~1\\QGISVA~1\\bin>set SAGA_MLB=C:\\saga_2.1.2_x64\\modules

C:\\PROGRA~1\\QGISVA~1\\bin>PATH=PATH;C:\\saga_2.1.2_x64;C:\\saga_2.1.2_x64\\modules

C:\\PROGRA~1\\QGISVA~1\\bin>saga_cmd grid_tools "Reclassify Grid Values" -INPUT "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\6e0fb1fd5ab0411a8b713cc62707d301\\aa2003.sgrd" -METHOD 0 -OLD 1 -NEW 1 -SOPERATOR 0 -MIN 0 -MAX 1 -RNEW 2 -ROPERATOR 0 -RETAB "C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\1401897077.515.txt" -TOPERATOR 0 -NODATAOPT -NODATA 0 -OTHEROPT -OTHERS 0 -RESULT "D:/EUQ2014/Dados/resultados_3/aa_2003_teste.tif.sgrd" 
_____________________________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
_____________________________________________

_____________________________________________
library path: C:\\saga_2.1.2_x64\\modules\\grid_tools.dll
library name: Grid - Tools
tool name : Reclassify Grid Values
author : Copyrights (c) 2005 by Volker Wichmann
_____________________________________________

Load table: C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\1401897077.515.txt...

Load grid: C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\6e0fb1fd5ab0411a8b713cc62707d301\\aa2003.sgrd...
failed

Usage: saga_cmd grid_tools 15 -INPUT [-RESULT ] [-METHOD ] [-OLD ] [-NEW ] [-SOPERATOR ] [-MIN ] [-MAX ] [-RNEW ] [-ROPERATOR ] [-RETAB ] [-TOPERATOR ] [-RETAB_2 ] [-F_MIN ] [-F_MAX ] [-F_CODE ] [-NODATAOPT] [-NODATA ] [-OTHEROPT] [-OTHERS ] [-RESULT_NODATA_CHOICE ] [-RESULT_NODATA_VALUE ]
-INPUT: Grid
Grid (input)
-RESULT: Reclassified Grid
Grid (output)
-METHOD: Method
Choice
Available Choices:
[0] single
[1] range
[2] simple table
[3] user supplied table
Default: 0
-OLD: old value
Floating point
Default: 0.000000
-NEW: new value
Floating point
Default: 1.000000
-SOPERATOR: operator
Choice
Available Choices:
[0] =
[1] 
[2] 
[3] >=
[4] >
Default: 0
-MIN: minimum value
Floating point
Default: 0.000000
-MAX: maximum value
Floating point
Default: 10.000000
-RNEW: new value
Floating point
Default: 5.000000
-ROPERATOR: operator
Choice
Available Choices:
[0] 
[1] 
Default: 0
-RETAB: Lookup Table
Static table
3 Fields:
- 1. [8 byte floating point number] minimum
- 2. [8 byte floating point number] maximum
- 3. [8 byte floating point number] new

-TOPERATOR: operator
Choice
Available Choices:
[0] min 
[1] min 
[2] min 
[3] min 
Default: 0
-RETAB_2: Lookup Table
Table (optional input)
-F_MIN: minimum value
Table field
-F_MAX: maximum value
Table field
-F_CODE: new value
Table field
-NODATAOPT no data values
Boolean
Default: 0
-NODATA: new value
Floating point
Default: 0.000000
-OTHEROPT other values
Boolean
Default: 0
-OTHERS: new value
Floating point
Default: 0.000000
-RESULT_NODATA_CHOICE: Assign ...
Choice
Available Choices:
[0] NoData value of input grid
[1] user defined NoData value
Default: 0
-RESULT_NODATA_VALUE: NoData Value
Floating point
Default: -99999.000000
Error: Grid file could not be opened.
Error: input file [C:\\Users\\pedro\\AppData\\Local\\Temp\\processing\\6e0fb1fd5ab0411a8b713cc62707d301\\aa2003.sgrd]
Error: Grid
Error: executing tool [Reclassify Grid Values]

C:\\PROGRA~1\\QGISVA~1\\bin>saga_cmd io_gdal 1 -GRIDS "D:/EUQ2014/Dados/resultados_3/aa_2003_teste.tif.sgrd" -FORMAT 4 -TYPE 0 -FILE "D:/EUQ2014/Dados/resultados_3/aa_2003_teste.tif" 
_____________________________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
_____________________________________________

69 loaded tool libraries (671 tools):
- climate_tools
- contrib_perego
- db_odbc
- db_pgsql
- docs_html
- docs_pdf
- garden_3d_viewer
- garden_fractals
- garden_games
- garden_learn_to_program
- garden_webservices
- grid_analysis
- grid_calculus
- grid_calculus_bsl
- grid_filter
- grid_gridding
- grid_spline
- grid_tools
- grid_visualisation
- imagery_classification
- imagery_opencv
- imagery_photogrammetry
- imagery_rga
- imagery_segmentation
- imagery_svm
- imagery_tools
- io_esri_e00
- io_gps
- io_grid
- io_grid_grib2
- io_grid_image
- io_shapes
- io_shapes_dxf
- io_shapes_las
- io_table
- io_virtual
- pj_georeference
- pj_geotrans
- pj_proj4
- pointcloud_tools
- pointcloud_viewer
- shapes_grid
- shapes_lines
- shapes_points
- shapes_polygons
- shapes_tools
- shapes_transect
- sim_cellular_automata
- sim_ecosystems_hugget
- sim_erosion
- sim_fire_spreading
- sim_hydrology
- sim_ihacres
- statistics_grid
- statistics_kriging
- statistics_points
- statistics_regression
- table_calculus
- table_tools
- ta_channels
- ta_compound
- ta_hydrology
- ta_lighting
- ta_morphometry
- ta_preprocessor
- ta_profiles
- ta_slope_stability
- tin_tools
- tin_viewer

type -h or --help for further information

Error: library

C:\\PROGRA~1\\QGISVA~1\\bin>exit
Converting outputs
Loading resulting layers
Algorithm Reclassify grid values finished

-RESULT_NODATA_CHOICE: Assign ...
Choice
Available Choices:
[0] NoData value of input grid
[1] user defined NoData value
Default: 0
-RESULT_NODATA_VALUE: NoData Value
Floating point
Default: -99999.000000

The solution was simple by adding this 2 parameters, but the problem is that using these parameters with previous versions of SAGA, gives error because it does not recognize these parameters.

History

#1 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Feedback

Here on QGIS master (and 2.2) + SAGA 2.1.2 (saga_2.1.2_x64) it works. It seems to me that anyway this two parameters are not "important".

We can of course add them in a description file for SAGA 2.1.2 (assuming that we want to keep processing up to date with the latest SAGA release) and leave the actual one for SAGA 2.0.8.

#2 Updated by Pedro Venâncio over 10 years ago

  • Status changed from Feedback to Closed

Ok, I tested with master version and it works. It may be a local problem with QGIS 2.2.

Does not seem an option to take for now, since not all repositories have SAGA 2.1.2 available, and who uses SAGA 2.1.0 to 2.1.1 would encounter problems. In the future, if we find that the new parameters are important, we opened a feature request or submit a pull request.

Thanks Giovanni!

#3 Updated by Giovanni Manghi over 9 years ago

  • Category changed from 94 to Processing/Core

Also available in: Atom PDF