Skip to content

Commit

Permalink
[processing] patch for issues with delimited text layers
Browse files Browse the repository at this point in the history
Still won't work when using delimited text layers in parameters of type MultipleInput
  • Loading branch information
volaya committed Nov 21, 2014
1 parent 1f47ffe commit 9f8a742
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 8 additions & 2 deletions python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -350,7 +350,10 @@ def setOutputCRS(self):
if isinstance(param, (ParameterRaster, ParameterVector, if isinstance(param, (ParameterRaster, ParameterVector,
ParameterMultipleInput)): ParameterMultipleInput)):
if param.value: if param.value:
inputlayers = param.value.split(';') if isinstance(param, ParameterMultipleInput):
inputlayers = param.value.split(';')
else:
inputlayers = [param.value]
for inputlayer in inputlayers: for inputlayer in inputlayers:
for layer in layers: for layer in layers:
if layer.source() == inputlayer: if layer.source() == inputlayer:
Expand All @@ -377,7 +380,10 @@ def checkInputCRS(self):
if isinstance(param, (ParameterRaster, ParameterVector, if isinstance(param, (ParameterRaster, ParameterVector,
ParameterMultipleInput)): ParameterMultipleInput)):
if param.value: if param.value:
layers = param.value.split(';') if isinstance(param, ParameterMultipleInput):
layers = param.value.split(';')
else:
layers = [param.value]
for item in layers: for item in layers:
crs = dataobjects.getObject(item).crs() crs = dataobjects.getObject(item).crs()
if crs not in crsList: if crs not in crsList:
Expand Down
7 changes: 3 additions & 4 deletions python/plugins/processing/tools/dataobjects.py
Expand Up @@ -89,10 +89,9 @@ def getVectorLayers(shapetype=[-1], sorting=True):
for layer in layers: for layer in layers:
mapLayer = layer.layer() mapLayer = layer.layer()
if mapLayer.type() == QgsMapLayer.VectorLayer: if mapLayer.type() == QgsMapLayer.VectorLayer:
if shapetype == ALL_TYPES or mapLayer.geometryType() in shapetype: if (mapLayer.hasGeometryType() and
uri = unicode(mapLayer.source()) (shapetype == ALL_TYPES or mapLayer.geometryType() in shapetype)):
if not uri.lower().endswith('csv') and not uri.lower().endswith('dbf'): vector.append(mapLayer)
vector.append(mapLayer)
if sorting: if sorting:
return sorted(vector, key=lambda layer: layer.name().lower()) return sorted(vector, key=lambda layer: layer.name().lower())
else: else:
Expand Down

0 comments on commit 9f8a742

Please sign in to comment.