Skip to content
Permalink
Browse files

[processing] fixed management of SAGA versions

fixes #13429
  • Loading branch information
volaya committed Sep 28, 2015
1 parent 91e1554 commit c7961b1cd9aae24351945d052519be164c32370a
Showing 469 changed files with 4,226 additions and 5 deletions.
@@ -45,9 +45,9 @@ class SagaAlgorithmProvider(AlgorithmProvider):

supportedVersions = {"2.1.2": ("2.1.2", SagaAlgorithm212),
"2.1.3": ("2.1.3", SagaAlgorithm213),
"2.1.4": ("2.1.3", SagaAlgorithm214),
# to allow testing upcoming release
"2.2.0": ("2.1.3", SagaAlgorithm214)}
"2.1.4": ("2.1.4", SagaAlgorithm214),
"2.2.0": ("2.2.0", SagaAlgorithm214)}


def __init__(self):
AlgorithmProvider.__init__(self)
@@ -87,9 +87,12 @@ def _loadAlgorithms(self):
self.tr('Problem with SAGA installation: SAGA was not found or is not correctly installed'))
return
if version not in self.supportedVersions:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
if version > self.supportedVersions.keys()[-1]:
version = self.supportedVersions.keys()[-1]
else:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with SAGA installation: installed SAGA version (%s) is not supported' % version))
return
return

folder = SagaUtils.sagaDescriptionPath()
folder = os.path.join(folder, self.supportedVersions[version][0])
@@ -0,0 +1,8 @@
Accumulated Cost (Anisotropic)
grid_analysis
ParameterRaster|COST|Cost Grid|False
ParameterRaster|DIRECTION|Direction of max cost|False
ParameterRaster|POINTS|Destination Points|False
ParameterNumber|K|k factor|None|None|1
ParameterNumber|THRESHOLD|Threshold for different route|None|None|0
OutputRaster|ACCCOST|Accumulated Cost
@@ -0,0 +1,7 @@
Accumulated Cost (Isotropic)
grid_analysis
ParameterRaster|COST|Cost Grid|False
ParameterRaster|POINTS|Destination Points|False
ParameterNumber|THRESHOLD|Threshold for different route|None|None|0.0
OutputRaster|ACCCOST|Accumulated Cost
OutputRaster|CLOSESTPT|Closest Point
@@ -0,0 +1,4 @@
Add Coordinates to points
shapes_points
ParameterVector|INPUT|Points|0|False
OutputVector|OUTPUT|Points with coordinates
@@ -0,0 +1,6 @@
Add Grid Values to Points
shapes_grid
ParameterVector|SHAPES|Points|0|False
ParameterMultipleInput|GRIDS|Grids|3|False
ParameterSelection|INTERPOL|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation
OutputVector|RESULT|Result
@@ -0,0 +1,6 @@
Add Grid Values to Shapes
shapes_grid
ParameterVector|SHAPES|Shapes|-1|False
ParameterMultipleInput|GRIDS|Grids|3|False
ParameterSelection|INTERPOL|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation
OutputVector|RESULT|Result
@@ -0,0 +1,6 @@
Add Polygon Attributes to Points
shapes_points
ParameterVector|INPUT|Points|0|False
ParameterVector|POLYGONS|Polygons|2|False
ParameterTableField|FIELDS|Attribute|POLYGONS|-1|False
OutputVector|OUTPUT|Result
@@ -0,0 +1,5 @@
Aggregate
grid_tools
ParameterRaster|INPUT|Grid|False
ParameterNumber|SIZE|Aggregation Size|None|None|3
ParameterSelection|METHOD|Method|[0] Sum;[1] Min;[2] Max
@@ -0,0 +1,14 @@
Aggregate Point Observations
shapes_points
ParameterVector|REFERENCE|Reference Points|-1|False
ParameterTableField|REFERENCE_ID|ID|REFERENCE|-1|False
ParameterTable|OBSERVATIONS|Observations|False
ParameterTableField|X|X|OBSERVATIONS|-1|False
ParameterTableField|Y|Y|OBSERVATIONS|-1|False
ParameterTableField|TRACK|Track|OBSERVATIONS|-1|False
ParameterTableField|DATE|Date|OBSERVATIONS|-1|False
ParameterTableField|TIME|Time|OBSERVATIONS|-1|False
ParameterTableField|PARAMETER|Parameter|OBSERVATIONS|-1|False
ParameterNumber|EPS_TIME|Maximum Time Span (Seconds)|None|None|60.0
ParameterNumber|EPS_SPACE|Maximum Distance|None|None|0.002
OutputTable|AGGREGATED|Aggregated
@@ -0,0 +1,5 @@
Aggregation Index
grid_analysis
ParameterRaster|INPUT|Input Grid|False
ParameterNumber|MAXNUMCLASS|Max. Number of Classes|None|None|5
OutputTable|RESULT|Result
@@ -0,0 +1,5 @@
Analytical Hierarchy Process
grid_analysis
ParameterMultipleInput|GRIDS|Input Grids|3|False
ParameterTable|TABLE|Pairwise Comparisons Table|False
OutputRaster|OUTPUT|Output Grid
@@ -0,0 +1,8 @@
Analytical Hillshading
ta_lighting
ParameterRaster|ELEVATION|Elevation|False
ParameterSelection|METHOD|Shading Method|[0] Standard;[1] Standard (max. 90Degree);[2] Combined Shading;[3] Ray Tracing
ParameterNumber|AZIMUTH|Azimuth [Degree]|None|None|315.0
ParameterNumber|DECLINATION|Declination [Degree]|None|None|45.0
ParameterNumber|EXAGGERATION|Exaggeration|None|None|4.0
OutputRaster|SHADE|Analytical Hillshading
@@ -0,0 +1,11 @@
B-Spline Approximation
grid_spline
ParameterVector|SHAPES|Points|0|False
ParameterTableField|FIELD|Attribute|SHAPES|-1|False
Hardcoded|-TARGET_DEFINITION 0
ParameterNumber|LEVEL|Resolution|0.001|None|1.0
Extent TARGET_USER_XMIN TARGET_USER_XMAX TARGET_USER_YMIN TARGET_USER_YMAX
ParameterNumber|TARGET_USER_SIZE|Cellsize|None|None|100.0
ParameterSelection|TARGET_USER_FITS|Fit|[0] nodes;[1] cells
ParameterRaster|TARGET_TEMPLATE|Target System|True
OutputRaster|TARGET_OUT_GRID|Grid
@@ -0,0 +1,8 @@
Burn Stream Network into DEM
ta_preprocessor
ParameterRaster|DEM|DEM|False
ParameterRaster|STREAM|Streams|False
ParameterRaster|FLOWDIR|Flow direction|False
ParameterSelection|METHOD|Method|[0] simply decrease cell's value by epsilon;[1] lower cell's value to neighbours minimum value minus epsilon;[2] trace stream network downstream
ParameterNumber|EPSILON|Epsilon|0.0|None|1.0
OutputRaster|BURN|Processed DEM
@@ -0,0 +1,17 @@
Catchment Area (Flow Tracing)
ta_hydrology
ParameterRaster|ELEVATION|Elevation|False
ParameterRaster|SINKROUTE|Sink Routes|True
ParameterRaster|WEIGHT|Weight|True
ParameterRaster|MATERIAL|Material|True
ParameterRaster|VAL_INPUT|Input for Mean over Catchment Calculation|True
ParameterRaster|TARGET|Target|True
ParameterNumber|STEP|Step|None|None|1
ParameterSelection|METHOD|Method|[0] Rho 8;[1] Kinematic Routing Algorithm;[2] DEMON
ParameterNumber|MINDQV|DEMON - Min. DQV|None|None|0.0
ParameterBoolean|CORRECT|Flow Correction|True
OutputRaster|CAREA|Catchment Area
OutputRaster|VAL_MEAN|Mean over Catchment
OutputRaster|ACCU_TOT|Total accumulated Material
OutputRaster|ACCU_LEFT|Accumulated Material from left side
OutputRaster|ACCU_RIGHT|Accumulated Material from right side
@@ -0,0 +1,5 @@
Catchment Area|Catchment Area (Parallel)
ta_hydrology
ParameterRaster|ELEVATION|Elevation|False
ParameterSelection|METHOD|Method|[0] Deterministic 8;[1] Rho 8;[2] Braunschweiger Reliefmodell;[3] Deterministic Infinity;[4] Multiple Flow Direction;[5] Multiple Triangular Flow Directon
OutputRaster|CAREA|Catchment Area
@@ -0,0 +1,18 @@
Catchment Area (Recursive)
ta_hydrology
ParameterRaster|ELEVATION|Elevation|False
ParameterRaster|SINKROUTE|Sink Routes|True
ParameterRaster|WEIGHT|Weight|True
ParameterRaster|MATERIAL|Material|True
ParameterRaster|VAL_INPUT|Input for Mean over Catchment Calculation|True
ParameterRaster|TARGET|Target|True
ParameterNumber|STEP|Step|None|None|1
ParameterRaster|TARGETS|Target Areas|True
ParameterSelection|METHOD|Method|[0] Deterministic 8;[1] Rho 8;[2] Deterministic Infinity;[3] Multiple Flow Direction
ParameterNumber|CONVERGENCE|Convergence|None|None|1.1
OutputRaster|CAREA|Catchment Area
OutputRaster|VAL_MEAN|Mean over Catchment
OutputRaster|ACCU_TOT|Total accumulated Material
OutputRaster|ACCU_LEFT|Accumulated Material from left side
OutputRaster|ACCU_RIGHT|Accumulated Material from right side
OutputRaster|FLOWLEN|Flow Path Length
@@ -0,0 +1,7 @@
Cell Balance
ta_hydrology
ParameterRaster|DEM|Elevation|False
ParameterRaster|WEIGHTS|Parameter|True
ParameterNumber|WEIGHTS_DEFAULT|Default Weight|0.0|None|1.0
ParameterSelection|METHOD|Method|[0] Deterministic 8;[1] Multiple Flow Direction
OutputRaster|BALANCE|Cell Balance
@@ -0,0 +1,7 @@
Change Date Format
table_tools
ParameterTable|TABLE|Table|False
ParameterTableField|FIELD|Date Field|TABLE|-1|False
ParameterSelection|FMT_IN|Input Format|[0] dd.mm.yy;[1] yy.mm.dd;[2] dd:mm:yy;[3] yy:mm:dd;[4] ddmmyyyy, fix size;[5] yyyymmdd, fix size;[6] ddmmyy, fix size;[7] yymmdd, fix size;[8] Julian Day
ParameterSelection|FMT_OUT|Output Format|[0] dd.mm.yy;[1] yy.mm.dd;[2] dd:mm:yy;[3] yy:mm:dd;[4] ddmmyyyy, fix size;[5] yyyymmdd, fix size;[6] ddmmyy, fix size;[7] yymmdd, fix size;[8] Julian Day
OutputTable|OUTPUT|Output
@@ -0,0 +1,16 @@
Change Detection
imagery_classification
ParameterRaster|INITIAL|Initial State|False
ParameterTable|INI_LUT|Look-up Table|True
ParameterTableField|INI_LUT_MIN|Value|INI_LUT|-1|False
ParameterTableField|INI_LUT_MAX|Value (Maximum)|INI_LUT|-1|False
ParameterTableField|INI_LUT_NAM|Name|INI_LUT|-1|False
ParameterRaster|FINAL|Final State|False
ParameterTable|FIN_LUT|Look-up Table|True
ParameterTableField|FIN_LUT_MIN|Value|FIN_LUT|-1|False
ParameterTableField|FIN_LUT_MAX|Value (Maximum)|FIN_LUT|-1|False
ParameterTableField|FIN_LUT_NAM|Name|FIN_LUT|-1|False
ParameterBoolean|NOCHANGE |Report Unchanged Classes|True
ParameterSelection|OUTPUT|Output as...|[0] cells;[1] percent;[2] area
OutputRaster|CHANGE|Changes
OutputTable|CHANGES|Changes
@@ -0,0 +1,6 @@
Change Grid Values
grid_tools
ParameterRaster|GRID_IN|Grid|False
ParameterSelection|METHOD|Replace Condition|[0] Grid value equals low value;[1] Low value < grid value < high value;[2] Low value <= grid value < high value
ParameterFixedTable|LOOKUP|Lookup Table|3|Low Value;High Value;Replace with|False
OutputRaster|GRID_OUT|Changed Grid
@@ -0,0 +1,7 @@
Change Time Format
table_tools
ParameterTable|TABLE|Table|False
ParameterTableField|FIELD|Time Field|TABLE|-1|False
ParameterSelection|FMT_IN|Input Format|[0] hh.mm.ss;[1] hh:mm:ss;[2] hhmmss, fix size;[3] hours;[4] minutes;[5] seconds
ParameterSelection|FMT_OUT|Output Format|[0] hh.mm.ss;[1] hh:mm:ss;[2] hhmmss, fix size;[3] hours;[4] minutes;[5] seconds
OutputTable|OUTPUT|Output
@@ -0,0 +1,14 @@
Channel Network
ta_channels
ParameterRaster|ELEVATION|Elevation|False
ParameterRaster|SINKROUTE|Flow Direction|True
ParameterRaster|INIT_GRID|Initiation Grid|False
ParameterSelection|INIT_METHOD|Initiation Type|[0] Less than;[1] Equals;[2] Greater than
ParameterNumber|INIT_VALUE|Initiation Threshold|None|None|0.0
ParameterRaster|DIV_GRID|Divergence|True
ParameterNumber|DIV_CELLS|Tracing: Max. Divergence|None|None|10
ParameterRaster|TRACE_WEIGHT|Tracing: Weight|True
ParameterNumber|MINLEN|Min. Segment Length|0.0|None|10
OutputRaster|CHNLNTWRK|Channel Network
OutputRaster|CHNLROUTE|Channel Direction
OutputVector|SHAPES|Channel Network
@@ -0,0 +1,11 @@
Channel Network and Drainage Basins
ta_channels
ParameterRaster|DEM|Elevation|False
ParameterNumber|THRESHOLD|Threshold|None|None|5.0
OutputRaster|DIRECTION|Flow Direction
OutputRaster|CONNECTION|Flow Connectivity
OutputRaster|ORDER|Strahler Order
OutputRaster|BASIN|Drainage Basins
OutputVector|SEGMENTS|Channels
OutputVector|BASINS|Drainage Basins
OutputVector|NODES|Junctions
@@ -0,0 +1,5 @@
Clip Grid with Polygon
shapes_grid
ParameterRaster|INPUT|Input|False
ParameterVector|POLYGONS|Polygons|2|False
OutputRaster|OUTPUT|Clipped
@@ -0,0 +1,7 @@
Clip Points with Polygons
shapes_points
ParameterVector|POINTS|Points|0|False
ParameterVector|POLYGONS|Polygons|2|False
ParameterTableField|FIELD|Add Attribute to Clipped Points|POLYGONS|-1|False
ParameterSelection|METHOD|Clipping Options|[0] one layer for all points;[1] separate layer for each polygon
OutputVector|CLIPS|Clipped Points
@@ -0,0 +1,6 @@
Close Gaps
grid_tools
ParameterRaster|INPUT|Grid|False
ParameterRaster|MASK|Mask|True
ParameterNumber|THRESHOLD|Tension Threshold|None|None|0.1
OutputRaster|RESULT|Changed Grid
@@ -0,0 +1,12 @@
Close Gaps with Spline
grid_tools
ParameterRaster|GRID|Grid|False
ParameterRaster|MASK|Mask|True
ParameterNumber|MAXGAPCELLS|Only Process Gaps with Less Cells|None|None|0
ParameterNumber|MAXPOINTS|Maximum Points|None|None|1000
ParameterNumber|LOCALPOINTS|Number of Points for Local Interpolation|None|None|10
ParameterBoolean|EXTENDED |Extended Neighourhood|True
ParameterSelection|NEIGHBOURS|Neighbourhood|[0] Neumann;[1] Moore
ParameterNumber|RADIUS|Radius (Cells)|None|None|0
ParameterNumber|RELAXATION|Relaxation|None|None|0.0
OutputRaster|CLOSED|Closed Gaps Grid
@@ -0,0 +1,4 @@
Close One Cell Gaps
grid_tools
ParameterRaster|INPUT|Grid|False
OutputRaster|RESULT|Changed Grid
@@ -0,0 +1,9 @@
Cluster Analysis for Grids
imagery_classification
ParameterMultipleInput|GRIDS|Grids|3.0|False
ParameterSelection|METHOD|Method|[0] Iterative Minimum Distance (Forgy 1965);[1] Hill-Climbing (Rubin 1967);[2] Combined Minimum Distance / Hillclimbing
ParameterNumber|NCLUSTER|Clusters|None|None|5
ParameterBoolean|NORMALISE |Normalise|True
ParameterBoolean|OLDVERSION |Old Version|True
OutputRaster|CLUSTER|Clusters
OutputTable|STATISTICS|Statistics
@@ -0,0 +1,8 @@
Contour Lines from Grid
shapes_grid
ParameterRaster|GRID|Grid|False
ParameterSelection|VERTEX|Vertex type|[0] x,y;[1] x,y,z
ParameterNumber|ZMIN|Minimum Contour Value|None|None|0.0
ParameterNumber|ZMAX|Maximum Contour Value|None|None|10000.0
ParameterNumber|ZSTEP|Equidistance|None|None|100.0
OutputVector|CONTOUR|Contour Lines
@@ -0,0 +1,11 @@
Convergence Index (Search Radius)
ta_morphometry
ParameterRaster|ELEVATION|Elevation|False
ParameterNumber|RADIUS|Radius [Cells]|1.0|None|10.0
ParameterSelection|DISTANCE_WEIGHTING_DW_WEIGHTING|Weighting Function|[0] no distance weighting;[1] inverse distance to a power;[2] exponential;[3] gaussian weighting
ParameterNumber|DISTANCE_WEIGHTING_DW_IDW_POWER|Inverse Distance Weighting Power|0.0|None|1.0
ParameterBoolean|DISTANCE_WEIGHTING_DW_IDW_OFFSET|Inverse Distance Offset|True
ParameterNumber|DISTANCE_WEIGHTING_DW_BANDWIDTH|Gaussian and Exponential Weighting Bandwidth|0.0|None|1.0
ParameterBoolean|SLOPE|Gradient|True
ParameterSelection|DIFFERENCE|Weighting Function|[0] direction to the center cell;[1] center cell's aspect direction
OutputRaster|CONVERGENCE|Convergence Index
@@ -0,0 +1,6 @@
Convergence Index
ta_morphometry
ParameterRaster|ELEVATION|Elevation|False
ParameterSelection|METHOD|Method|[0] Aspect;[1] Gradient
ParameterSelection|NEIGHBOURS|Gradient Calculation|[0] 2 x 2;[1] 3 x 3
OutputRaster|RESULT|Convergence Index
@@ -0,0 +1,5 @@
Convert Data Storage Type
grid_tools
ParameterRaster|INPUT|Grid|False
ParameterSelection|TYPE|Data storage type|[0] bit;[1] unsigned 1 byte integer;[2] signed 1 byte integer;[3] unsigned 2 byte integer;[4] signed 2 byte integer;[5] unsigned 4 byte integer;[6] signed 4 byte integer;[7] 4 byte floating point number;[8] 8 byte floating point number
OutputRaster|OUTPUT|Converted Grid
@@ -0,0 +1,6 @@
Convert Lines to Points
shapes_points
ParameterVector|LINES|Lines|1|False
ParameterBoolean|ADD |Insert Additional Points|True
ParameterNumber|DIST|Insert Distance|0.0|None|1.0
OutputVector|POINTS|Points
@@ -0,0 +1,4 @@
Convert Lines to Polygons
shapes_polygons
ParameterVector|LINES|Lines|1|False
OutputVector|POLYGONS|Polygons
@@ -0,0 +1,4 @@
Convert Multipoints to Points
shapes_points
ParameterVector|MULTIPOINTS|Multipoints|0|False
OutputVector|POINTS|Points
@@ -0,0 +1,6 @@
Convert Points to Line(s)
shapes_lines
ParameterVector|POINTS|Points|0|False
ParameterTableField|ORDER|Order by...|POINTS|-1|False
ParameterTableField|SEPARATE|Separate by...|POINTS|-1|False
OutputVector|LINES|Lines
@@ -0,0 +1,4 @@
Convert Polygon/Line Vertices to Points
shapes_polygons
ParameterVector|SHAPES|Shapes|-1|False
OutputVector|POINTS|Points
@@ -0,0 +1,4 @@
Convert Polygons to Lines
shapes_lines
ParameterVector|POLYGONS|Polygons|2|False
OutputVector|LINES|Lines
@@ -0,0 +1,6 @@
Convex Hull
shapes_points
ParameterVector|SHAPES|Points|0|False
ParameterSelection|POLYPOINTS|Hull Construction|[0] one hull for all shapes;[1] one hull per shape;[2] one hull per shape part
OutputVector|HULLS|Convex Hull
OutputVector|BOXES|Minimum Bounding Box
@@ -0,0 +1,8 @@
Create Graticule
shapes_tools
ParameterVector|EXTENT|Extent|-1|True
Extent X_EXTENT_MIN X_EXTENT_MAX Y_EXTENT_MIN Y_EXTENT_MAX
ParameterNumber|DISTX|Division Width|None|None|1.0
ParameterNumber|DISTY|Division Height|None|None|1.0
ParameterSelection|TYPE|Type|[0] Lines;[1] Rectangles
OutputVector|GRATICULE|Graticule
@@ -0,0 +1,4 @@
Crop to Data
grid_tools
ParameterRaster|INPUT|Input layer|False
OutputRaster|OUTPUT|Cropped

2 comments on commit c7961b1

@PedroVenancio

This comment has been minimized.

Copy link
Contributor

@PedroVenancio PedroVenancio replied Sep 28, 2015

Hi @volaya

I've compiled after this commit and I'm getting a Python error: Couldn't load plugin processing due to an error when calling its initGui() method See message log (Python Error) for more details.

2015-09-28T23:39:08 1 Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 252, in startPlugin
plugins[packageName].initGui()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/ProcessingPlugin.py", line 57, in initGui
Processing.initialize()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/core/Processing.py", line 150, in initialize
Processing.loadFromProviders()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/core/Processing.py", line 166, in loadFromProviders
Processing.loadAlgorithms()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/core/Processing.py", line 201, in loadAlgorithms
Processing.updateProviders()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/core/Processing.py", line 174, in updateProviders
provider.loadAlgorithms()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/core/AlgorithmProvider.py", line 58, in loadAlgorithms
self._loadAlgorithms()
File "/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py", line 99, in _loadAlgorithms
for descriptionFile in os.listdir(folder):
OSError: [Errno 2] Ficheiro ou directoria inexistente: '/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/algs/saga/description/2.2.0'

Thanks!

@PedroVenancio

This comment has been minimized.

Copy link
Contributor

@PedroVenancio PedroVenancio replied Sep 28, 2015

In this folder (/home/pedro/QGIS_Debug_15/share/qgis/python/plugins/processing/algs/saga/description/) I just had 2.1.2 and 2.1.3 folders. After manually copy the 2.2.0 folder to this location, the error disappeared and Processing returned to work.

Please sign in to comment.
You can’t perform that action at this time.