-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Processing] Add SAGA LTR support in 2.18
- Loading branch information
Showing
250 changed files
with
2,299 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
SagaAlgorithm230.py | ||
--------------------- | ||
Date : March 2017 | ||
Copyright : (C) 2017 by Victor Olaya | ||
Email : volayaf 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__ = 'Victor Olaya' | ||
__date__ = 'March 2017' | ||
__copyright__ = '(C) 2017, Victor Olaya' | ||
|
||
# This will get replaced with a git SHA1 when you do a git archive | ||
|
||
__revision__ = '$Format:%H$' | ||
|
||
import os | ||
from SagaAlgorithm214 import SagaAlgorithm214 | ||
from processing.tools import dataobjects | ||
from processing.tools.system import getTempFilenameInTempFolder | ||
|
||
sessionExportedLayers = {} | ||
|
||
|
||
class SagaAlgorithm230(SagaAlgorithm214): | ||
|
||
def getCopy(self): | ||
newone = SagaAlgorithm230(self.descriptionFile) | ||
newone.provider = self.provider | ||
return newone | ||
|
||
def exportRasterLayer(self, source): | ||
global sessionExportedLayers | ||
if source in sessionExportedLayers: | ||
exportedLayer = sessionExportedLayers[source] | ||
if os.path.exists(exportedLayer): | ||
self.exportedLayers[source] = exportedLayer | ||
return None | ||
else: | ||
del sessionExportedLayers[source] | ||
layer = dataobjects.getObjectFromUri(source, False) | ||
if layer: | ||
filename = layer.name() | ||
else: | ||
filename = os.path.basename(source) | ||
validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:' | ||
filename = ''.join(c for c in filename if c in validChars) | ||
if len(filename) == 0: | ||
filename = 'layer' | ||
destFilename = getTempFilenameInTempFolder(filename + '.sgrd') | ||
self.exportedLayers[source] = destFilename | ||
sessionExportedLayers[source] = destFilename | ||
return 'io_gdal 0 -TRANSFORM 1 -RESAMPLING 0 -GRIDS "' + destFilename + '" -FILES "' + source + '"' |
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
8 changes: 8 additions & 0 deletions
8
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -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 |
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -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 |
4 changes: 4 additions & 0 deletions
4
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Add Coordinates to points | ||
shapes_points | ||
ParameterVector|INPUT|Points|0|False | ||
OutputVector|OUTPUT|Points with coordinates |
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -0,0 +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 | ||
AllowUnmatching |
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -0,0 +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 | ||
AllowUnmatching |
7 changes: 7 additions & 0 deletions
7
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -0,0 +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 |
6 changes: 6 additions & 0 deletions
6
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -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 |
5 changes: 5 additions & 0 deletions
5
python/plugins/processing/algs/saga/description/2.3.0/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 |
---|---|---|
@@ -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 |
14 changes: 14 additions & 0 deletions
14
python/plugins/processing/algs/saga/description/2.3.0/AggregatePointObservations.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 |
---|---|---|
@@ -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 |
5 changes: 5 additions & 0 deletions
5
python/plugins/processing/algs/saga/description/2.3.0/AggregationIndex.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the f