[processing] allow geometry types to be specified when defining inputs in scripts

This commit is contained in:
Victor Olaya 2013-11-06 00:21:40 +01:00
parent e43b8a5311
commit c4e39abc36

View File

@ -52,7 +52,6 @@ from processing.outputs.OutputFile import OutputFile
from processing.outputs.OutputFactory import OutputFactory from processing.outputs.OutputFactory import OutputFactory
from processing.script.WrongScriptException import WrongScriptException from processing.script.WrongScriptException import WrongScriptException
class ScriptAlgorithm(GeoAlgorithm): class ScriptAlgorithm(GeoAlgorithm):
def __init__(self, descriptionFile, script=None): def __init__(self, descriptionFile, script=None):
@ -141,6 +140,15 @@ class ScriptAlgorithm(GeoAlgorithm):
elif tokens[1].lower().strip() == 'vector': elif tokens[1].lower().strip() == 'vector':
param = ParameterVector(tokens[0], desc, param = ParameterVector(tokens[0], desc,
[ParameterVector.VECTOR_TYPE_ANY]) [ParameterVector.VECTOR_TYPE_ANY])
elif tokens[1].lower().strip() == 'vector point':
param = ParameterVector(tokens[0], desc,
[ParameterVector.VECTOR_TYPE_POINT])
elif tokens[1].lower().strip() == 'vector line':
param = ParameterVector(tokens[0], desc,
[ParameterVector.VECTOR_TYPE_LINE])
elif tokens[1].lower().strip() == 'vector polygon':
param = ParameterVector(tokens[0], desc,
[ParameterVector.VECTOR_TYPE_POLYGON])
elif tokens[1].lower().strip() == 'table': elif tokens[1].lower().strip() == 'table':
param = ParameterTable(tokens[0], desc, False) param = ParameterTable(tokens[0], desc, False)
elif tokens[1].lower().strip() == 'multiple raster': elif tokens[1].lower().strip() == 'multiple raster':