Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5155 from alexbruy/processing-saga
[processing] port SAGA to new API
- Loading branch information
Showing
394 changed files
with
3,291 additions
and
3,133 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
SagaAlgorithmBase.py | ||
--------------------- | ||
Date : August 2017 | ||
Copyright : (C) 2017 by Nyall Dawson | ||
Email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__author__ = 'Nyall Dawson' | ||
__date__ = 'August 2017' | ||
__copyright__ = '(C) 2017, Nyall Dawson' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
import os | ||
|
||
from qgis.PyQt.QtCore import QCoreApplication | ||
from qgis.PyQt.QtGui import QIcon | ||
from qgis.core import QgsProcessingAlgorithm | ||
|
||
|
||
pluginPath = os.path.normpath(os.path.join( | ||
os.path.split(os.path.dirname(__file__))[0], os.pardir)) | ||
|
||
|
||
class SagaAlgorithmBase(QgsProcessingAlgorithm): | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
def icon(self): | ||
return QIcon(os.path.join(pluginPath, 'images', 'saga.png')) | ||
|
||
def createInstance(self, config={}): | ||
return self.__class__() | ||
|
||
def tr(self, string): | ||
return QCoreApplication.translate("SAGAAlgorithm", string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
ANGMAP | ||
ta_slope_stability | ||
ParameterRaster|DEM|Elevation|False | ||
ParameterRaster|C|Dip grid (degrees)|True | ||
ParameterRaster|D|Dip direction grid (degrees)|True | ||
ParameterNumber|fB|Global structure dip (degrees)|None|None| 45.000000 | ||
ParameterNumber|fC|Global structure dip direction (degrees)|None|None| 90.000000 | ||
OutputRaster|E|Angle | ||
OutputRaster|F|CL dipdir | ||
OutputRaster|G|CL dip | ||
QgsProcessingParameterRasterLayer|DEM|Elevation|None|False | ||
QgsProcessingParameterRasterLayer|C|Dip grid (degrees)|None|True | ||
QgsProcessingParameterRasterLayer|D|Dip direction grid (degrees)|None|True | ||
QgsProcessingParameterNumber|fB|Global structure dip (degrees)|QgsProcessingParameterNumber.Double|45.000000|False|None|None | ||
QgsProcessingParameterNumber|fC|Global structure dip direction (degrees)|QgsProcessingParameterNumber.Double|90.000000|False|None|None | ||
QgsProcessingParameterRasterDestination|E|Angle | ||
QgsProcessingParameterRasterDestination|F|CL dipdir | ||
QgsProcessingParameterRasterDestination|G|CL dip |
12 changes: 6 additions & 6 deletions
12
python/plugins/processing/algs/saga/description/AccumulatedCost(Anisotropic).txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +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 | ||
QgsProcessingParameterRasterLayer|COST|Cost Grid|None|False | ||
QgsProcessingParameterRasterLayer|DIRECTION|Direction of max cost|None|False | ||
QgsProcessingParameterRasterLayer|POINTS|Destination Points|None|False | ||
QgsProcessingParameterNumber|K|k factor|QgsProcessingParameterNumber.Integer|1|False|None|None | ||
QgsProcessingParameterNumber|THRESHOLD|Threshold for different route|QgsProcessingParameterNumber.Integer|0|False|None|None | ||
QgsProcessingParameterRasterDestination|ACCCOST|Accumulated Cost |
10 changes: 5 additions & 5 deletions
10
python/plugins/processing/algs/saga/description/AccumulatedCost(Isotropic).txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +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 | ||
QgsProcessingParameterRasterLayer|COST|Cost Grid|None|False | ||
QgsProcessingParameterRasterLayer|POINTS|Destination Points|None|False | ||
QgsProcessingParameterNumber|THRESHOLD|Threshold for different route|QgsProcessingParameterNumber.Double|0.0|False|None|None | ||
QgsProcessingParameterRasterDestination|ACCCOST|Accumulated Cost | ||
QgsProcessingParameterRasterDestination|CLOSESTPT|Closest Point |
20 changes: 10 additions & 10 deletions
20
python/plugins/processing/algs/saga/description/AccumulatedCost.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Accumulated Cost | ||
grid_analysis | ||
ParameterSelection|DEST_TYPE|Input Type of Destinations|[0] Point;[1] Grid| 0 | ||
ParameterVector|DEST_POINTS|Destinations|-1|False | ||
ParameterRaster|DEST_GRID|Destinations|False | ||
ParameterRaster|COST|Local Cost|False | ||
ParameterRaster|DIR_MAXCOST|Direction of Maximum Cost|True | ||
ParameterSelection|DIR_UNIT|Units of Direction|[0] radians;[1] degree| 0 | ||
ParameterNumber|DIR_K|K Factor|None|None| 2.000000 | ||
OutputRaster|ACCUMULATED|Accumulated Cost | ||
OutputRaster|ALLOCATION|Allocation | ||
ParameterNumber|THRESHOLD|Threshold for different route| 0.000000|None| 0.000000 | ||
QgsProcessingParameterEnum|DEST_TYPE|Input Type of Destinations|[0] Point;[1] Grid|False|0 | ||
QgsProcessingParameterFeatureSource|DEST_POINTS|Destinations|-1|None|False | ||
QgsProcessingParameterRasterLayer|DEST_GRID|Destinations|None|False | ||
QgsProcessingParameterRasterLayer|COST|Local Cost|None|False | ||
QgsProcessingParameterRasterLayer|DIR_MAXCOST|Direction of Maximum Cost|None|True | ||
QgsProcessingParameterEnum|DIR_UNIT|Units of Direction|[0] radians;[1] degree|False|0 | ||
QgsProcessingParameterNumber|DIR_K|K Factor|QgsProcessingParameterNumber.Double|2.000000|False|None|None | ||
QgsProcessingParameterRasterDestination|ACCUMULATED|Accumulated Cost | ||
QgsProcessingParameterRasterDestination|ALLOCATION|Allocation | ||
QgsProcessingParameterNumber|THRESHOLD|Threshold for different route|QgsProcessingParameterNumber.Double|0.000000|False| 0.000000|None |
20 changes: 10 additions & 10 deletions
20
python/plugins/processing/algs/saga/description/AccumulationFunctions.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Accumulation Functions | ||
grid_analysis | ||
ParameterRaster|SURFACE|Surface|False | ||
ParameterRaster|INPUT|Input|False | ||
ParameterRaster|STATE_IN|State t|True | ||
ParameterRaster|CONTROL|Operation Control|True | ||
ParameterRaster|CTRL_LINEAR|Linear Flow Control Grid|True | ||
OutputRaster|FLUX|Flux | ||
OutputRaster|STATE_OUT|State t + 1 | ||
ParameterSelection|OPERATION|Operation|[0] accuflux;[1] accucapacityflux / state;[2] accufractionflux / state;[3] accuthresholdflux / state;[4] accutriggerflux / state| 0 | ||
ParameterBoolean|LINEAR|Switch to Linear Flow|True | ||
ParameterNumber|THRES_LINEAR|Threshold Linear Flow|None|None| 0.000000 | ||
QgsProcessingParameterRasterLayer|SURFACE|Surface|None|False | ||
QgsProcessingParameterRasterLayer|INPUT|Input|None|False | ||
QgsProcessingParameterRasterLayer|STATE_IN|State t|None|True | ||
QgsProcessingParameterRasterLayer|CONTROL|Operation Control|None|True | ||
QgsProcessingParameterRasterLayer|CTRL_LINEAR|Linear Flow Control Grid|None|True | ||
QgsProcessingParameterRasterDestination|FLUX|Flux | ||
QgsProcessingParameterRasterDestination|STATE_OUT|State t + 1 | ||
QgsProcessingParameterEnum|OPERATION|Operation|[0] accuflux;[1] accucapacityflux / state;[2] accufractionflux / state;[3] accuthresholdflux / state;[4] accutriggerflux / state|False|0 | ||
QgsProcessingParameterBoolean|LINEAR|Switch to Linear Flow|True | ||
QgsProcessingParameterNumber|THRES_LINEAR|Threshold Linear Flow|QgsProcessingParameterNumber.Double|0.000000|False|None|None |
4 changes: 2 additions & 2 deletions
4
python/plugins/processing/algs/saga/description/AddCoordinatestopoints.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Add Coordinates to points | ||
shapes_points | ||
ParameterVector|INPUT|Points|0|False | ||
OutputVector|OUTPUT|Points with coordinates | ||
QgsProcessingParameterFeatureSource|INPUT|Points|0|None|False | ||
QgsProcessingParameterVectorDestination|OUTPUT|Points with coordinates |
8 changes: 4 additions & 4 deletions
8
python/plugins/processing/algs/saga/description/AddGridValuestoPoints.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
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 | ||
QgsProcessingParameterFeatureSource|SHAPES|Points|0|None|False | ||
QgsProcessingParameterMultipleLayers|GRIDS|Grids|3|None|False | ||
QgsProcessingParameterEnum|INTERPOL|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation | ||
QgsProcessingParameterVectorDestination|RESULT|Result | ||
AllowUnmatching |
8 changes: 4 additions & 4 deletions
8
python/plugins/processing/algs/saga/description/AddGridValuestoShapes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
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 | ||
QgsProcessingParameterFeatureSource|SHAPES|Shapes|-1|None|False | ||
QgsProcessingParameterMultipleLayers|GRIDS|Grids|3|None|False | ||
QgsProcessingParameterEnum|INTERPOL|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation | ||
QgsProcessingParameterVectorDestination|RESULT|Result | ||
AllowUnmatching |
8 changes: 4 additions & 4 deletions
8
python/plugins/processing/algs/saga/description/AddIndicatorFieldsforCategories.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Add Indicator Fields for Categories | ||
table_tools | ||
ParameterTable|TABLE|Table|False | ||
ParameterTable|FIELD|Categories|False | ||
ParameterTable|OUT_TABLE|Output table with field(s) deleted|True | ||
OutputVector|OUT_SHAPES|Output shapes with field(s) deleted | ||
QgsProcessingParameterFeatureSource|TABLE|Table|5|None|False | ||
QgsProcessingParameterFeatureSource|FIELD|Categories|5|None|False | ||
QgsProcessingParameterFeatureSource|OUT_TABLE|Output table with field(s) deleted|5|None|True | ||
QgsProcessingParameterVectorDestination|OUT_SHAPES|Output shapes with field(s) deleted |
10 changes: 5 additions & 5 deletions
10
python/plugins/processing/algs/saga/description/AddPointAttributestoPolygons.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Add Point Attributes to Polygons | ||
shapes_polygons | ||
ParameterVector|INPUT|Polygons|2|False | ||
ParameterVector|POINTS|Points|0|False | ||
ParameterTableField|FIELDS|Attributes|POINTS|-1|False | ||
ParameterBoolean|ADD_LOCATION_INFO|Add location info|False | ||
OutputVector|OUTPUT|Result | ||
QgsProcessingParameterFeatureSource|INPUT|Polygons|2|None|False | ||
QgsProcessingParameterFeatureSource|POINTS|Points|0|None|False | ||
QgsProcessingParameterField|FIELDS|Attributes|None|POINTS|-1|False|False | ||
QgsProcessingParameterBoolean|ADD_LOCATION_INFO|Add locPation info|False | ||
QgsProcessingParameterVectorDestination|OUTPUT|Result |
8 changes: 4 additions & 4 deletions
8
python/plugins/processing/algs/saga/description/AddPolygonAttributestoPoints.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +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 | ||
QgsProcessingParameterFeatureSource|INPUT|Points|0|None|False | ||
QgsProcessingParameterFeatureSource|POLYGONS|Polygons|2|None|False | ||
QgsProcessingParameterField|FIELDS|Attribute|None|POLYGONS|-1|False|False | ||
QgsProcessingParameterVectorDestination|OUTPUT|Result |
6 changes: 3 additions & 3 deletions
6
python/plugins/processing/algs/saga/description/Aggregate.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +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 | ||
QgsProcessingParameterRasterLayer|INPUT|Grid|None|False | ||
QgsProcessingParameterNumber|SIZE|Aggregation Size|QgsProcessingParameterNumber.Integer|3|False|None|None | ||
QgsProcessingParameterEnum|METHOD|Method|[0] Sum;[1] Min;[2] Max |
Oops, something went wrong.