I am using QGIS, and I would like to write a script to help processing the data.
To do so, I have to reclassify heights values from a raster. I have written the following code, where
retab is the path to the file containing the reclassification rules (see later) :
##Layer1=raster from qgis.core import * from qgis.gui import * from qgis.utils import iface from PyQt4.QtCore import * from PyQt4.QtGui import * import os import processing retab = "E:\\Divers\\Qgis\\Scripts\\tab_reclass.txt" #processing.runalg('saga:reclassifygridvalues', input, method, old, new, soperator, min, max, rnew, roperator, retab, toperator, nodataopt, nodata, otheropt, others, result) Layerout=processing.runalg('saga:reclassifygridvalues', Layer1, 2, 0, 0, 0, 0, 0, 0, retab, 0, 0, 0, 0, 0, 0, 0)
The code gives the following error :
Error: Wrong parameter value: E:\Divers\Qgis\Scripts\tab_reclass.txt
My rules are the following :
minimum maximum new 0 0.5 1 0.5 2 2 2 1000 3
I could not find a clear example on how to use the table rules, so I guess that it is where the error comes from.
If possible, I would prefer using the rules from the script rather than from the external file.