Skip to content
Permalink
Browse files
[processing] allow multiple selection of tables
  • Loading branch information
volaya committed Dec 5, 2016
1 parent 57d80a5 commit 16da9063989714824ab4f581d9d82b809ba62d92
Showing with 12 additions and 3 deletions.
  1. +3 −2 python/plugins/processing/algs/qgis/Datasources2Vrt.py
  2. +8 −0 python/plugins/processing/gui/wrappers.py
  3. +1 −1 python/plugins/processing/tools/dataobjects.py
@@ -32,6 +32,7 @@

from osgeo import ogr

from processing.tools import dataobjects
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterMultipleInput
@@ -52,7 +53,8 @@ def defineCharacteristics(self):
self.group, self.i18n_group = self.trAlgorithm('Vector general tools')

self.addParameter(ParameterMultipleInput(self.DATASOURCES,
self.tr('Input datasources')))
self.tr('Input datasources'),
dataobjects.TYPE_TABLE))
self.addParameter(ParameterBoolean(self.UNIONED,
self.tr('Create "unioned" VRT'),
default=False))
@@ -66,7 +68,6 @@ def processAlgorithm(self, progress):
input_layers = self.getParameterValue(self.DATASOURCES)
unioned = self.getParameterValue(self.UNIONED)
vrtPath = self.getOutputValue(self.VRT_FILE)
vrtString = self.getOutputValue(self.VRT_STRING)

layers = input_layers.split(';')

@@ -461,6 +461,8 @@ def _getOptions(self):
[dataobjects.TYPE_VECTOR_POLYGON, dataobjects.TYPE_VECTOR_ANY])
elif self.param.datatype == dataobjects.TYPE_RASTER:
options = self.dialog.getAvailableValuesOfType(ParameterRaster, OutputRaster)
elif self.param.datatype == dataobjects.TYPE_TABLE:
options = self.dialog.getAvailableValuesOfType(ParameterTable, OutputTable)
else:
options = self.dialog.getAvailableValuesOfType(ParameterFile, OutputFile)
options = sorted(options, key=lambda opt: self.dialog.resolveValueDescription(opt))
@@ -475,6 +477,8 @@ def createWidget(self):
options = dataobjects.getRasterLayers(sorting=False)
elif self.param.datatype == dataobjects.TYPE_VECTOR_ANY:
options = dataobjects.getVectorLayers(sorting=False)
elif self.param.datatype == dataobjects.TYPE_TABLE:
options = dataobjects.getTables(sorting=False)
else:
options = dataobjects.getVectorLayers([self.param.datatype], sorting=False)
opts = [getExtendedLayerName(opt) for opt in options]
@@ -493,6 +497,8 @@ def refresh(self):
options = dataobjects.getRasterLayers(sorting=False)
elif self.param.datatype == dataobjects.TYPE_VECTOR_ANY:
options = dataobjects.getVectorLayers(sorting=False)
elif self.param.datatype == dataobjects.TYPE_TABLE:
options = dataobjects.getTables(sorting=False)
else:
options = dataobjects.getVectorLayers([self.param.datatype], sorting=False)
opts = [self.getExtendedLayerName(opt) for opt in options]
@@ -520,6 +526,8 @@ def value(self):
options = dataobjects.getRasterLayers(sorting=False)
elif self.param.datatype == dataobjects.TYPE_VECTOR_ANY:
options = dataobjects.getVectorLayers(sorting=False)
elif self.param.datatype == dataobjects.TYPE_TABLE:
options = dataobjects.getTables(sorting=False)
else:
options = dataobjects.getVectorLayers([self.param.datatype], sorting=False)
return [options[i] for i in self.widget.selectedoptions]
@@ -58,7 +58,7 @@
TYPE_VECTOR_POLYGON = 2
TYPE_RASTER = 3
TYPE_FILE = 4

TYPE_TABLE = 5

_loadedLayers = {}

0 comments on commit 16da906

Please sign in to comment.