Skip to content
Permalink
Browse files

[processing] add support for ParameterPoint to major algorothm providers

  • Loading branch information
alexbruy committed Feb 29, 2016
1 parent 841de7e commit dd68c33eb474a41c814dd069fbe05628b0df6620
@@ -42,8 +42,22 @@
from processing.core.ProcessingLog import ProcessingLog
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException

from processing.core.parameters import getParameterFromString, ParameterVector, ParameterMultipleInput, ParameterExtent, ParameterNumber, ParameterSelection, ParameterRaster, ParameterTable, ParameterBoolean, ParameterString
from processing.core.outputs import getOutputFromString, OutputRaster, OutputVector, OutputFile, OutputHTML
from processing.core.parameters import (getParameterFromString,
ParameterVector,
ParameterMultipleInput,
ParameterExtent,
ParameterNumber,
ParameterSelection,
ParameterRaster,
ParameterTable,
ParameterBoolean,
ParameterString,
ParameterPoint)
from processing.core.outputs import (getOutputFromString,
OutputRaster,
OutputVector,
OutputFile,
OutputHTML)

from GrassUtils import GrassUtils

@@ -332,6 +346,8 @@ def processAlgorithm(self, progress):
command += ' ' + param.name + '=' + unicode(param.options[idx])
elif isinstance(param, ParameterString):
command += ' ' + param.name + '="' + unicode(param.value) + '"'
elif isinstance(param, ParameterPoint):
command += ' ' + param.name + '=' + unicode(param.value)
else:
command += ' ' + param.name + '="' + unicode(param.value) + '"'

@@ -3,6 +3,6 @@ r.lake.coords - Fills lake at given point to given level.
Raster (r.*)
ParameterRaster|dem|Elevation|False
ParameterNumber|wl|Water level|None|None|1000.0
ParameterString|xy|Seed point coordinates|0,0
ParameterPoint|xy|Seed point coordinates|
ParameterBoolean|-n|Use negative depth values for lake raster layer|False
OutputRaster|lake|Lake
@@ -41,8 +41,22 @@
from processing.core.ProcessingLog import ProcessingLog
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException

from processing.core.parameters import getParameterFromString, ParameterVector, ParameterMultipleInput, ParameterExtent, ParameterNumber, ParameterSelection, ParameterRaster, ParameterTable, ParameterBoolean, ParameterString
from processing.core.outputs import getOutputFromString, OutputRaster, OutputVector, OutputFile, OutputHTML
from processing.core.parameters import (getParameterFromString,
ParameterVector,
ParameterMultipleInput,
ParameterExtent,
ParameterNumber,
ParameterSelection,
ParameterRaster,
ParameterTable,
ParameterBoolean,
ParameterString,
ParameterPoint)
from processing.core.outputs import (getOutputFromString,
OutputRaster,
OutputVector,
OutputFile,
OutputHTML)

from Grass7Utils import Grass7Utils

@@ -390,6 +404,8 @@ def processCommand(self):
command += ' ' + param.name + '=' + unicode(param.options[idx])
elif isinstance(param, ParameterString):
command += ' ' + param.name + '="' + unicode(param.value) + '"'
elif isinstance(param, ParameterPoint):
command += ' ' + param.name + '=' + unicode(param.value)
else:
command += ' ' + param.name + '="' + unicode(param.value) + '"'

@@ -2,5 +2,5 @@ r.water.outlet
Watershed basin creation program.
Raster (r.*)
ParameterRaster|input|Name of input raster map|False
ParameterString|coordinates|Coordinates of outlet point|
ParameterPoint|coordinates|Coordinates of outlet point|
OutputRaster|output|Basin
@@ -44,6 +44,7 @@
from processing.core.parameters import ParameterTableField
from processing.core.parameters import ParameterExtent
from processing.core.parameters import ParameterFile
from processing.core.parameters import ParameterPoint
from processing.core.outputs import OutputTable
from processing.core.outputs import OutputVector
from processing.core.outputs import OutputRaster
@@ -199,6 +200,8 @@ def processParameterLine(self, line):
param = ParameterTableField(tokens[0], tokens[0], field)
elif tokens[1].lower().strip() == 'extent':
param = ParameterExtent(tokens[0], desc)
elif tokens[1].lower().strip() == 'point':
param = ParameterPoint(tokens[0], desc)
elif tokens[1].lower().strip() == 'file':
param = ParameterFile(tokens[0], desc, False)
elif tokens[1].lower().strip() == 'folder':
@@ -35,12 +35,24 @@
from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.ProcessingLog import ProcessingLog
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import getParameterFromString, ParameterExtent, ParameterRaster, ParameterVector, ParameterTable, ParameterMultipleInput, ParameterBoolean, ParameterFixedTable, ParameterNumber, ParameterSelection
from processing.core.outputs import getOutputFromString, OutputTable, OutputVector, OutputRaster
import SagaUtils
from processing.core.parameters import (getParameterFromString,
ParameterExtent,
ParameterRaster,
ParameterVector,
ParameterTable,
ParameterMultipleInput,
ParameterBoolean,
ParameterFixedTable,
ParameterNumber,
ParameterSelection)
from processing.core.outputs import (getOutputFromString,
OutputTable,
OutputVector,
OutputRaster)
from processing.tools import dataobjects
from processing.tools.system import getTempFilename, getTempFilenameInTempFolder
from processing.algs.saga.SagaNameDecorator import *
import SagaUtils

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))
@@ -41,6 +41,7 @@
from processing.core.parameters import ParameterTableField
from processing.core.parameters import ParameterExtent
from processing.core.parameters import ParameterFile
from processing.core.parameters import ParameterPoint
from processing.core.parameters import getParameterFromString
from processing.core.outputs import OutputTable
from processing.core.outputs import OutputVector
@@ -223,6 +224,8 @@ def processInputParameterToken(self, token, name):
param = ParameterBoolean(name, descName)
elif token.lower().strip() == 'extent':
param = ParameterExtent(name, descName)
elif token.lower().strip() == 'point':
param = ParameterPoint(name, descName)
elif token.lower().strip() == 'file':
param = ParameterFile(name, descName, False)
elif token.lower().strip() == 'folder':

0 comments on commit dd68c33

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