Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] patch for issues with delimited text layers
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,
ParameterMultipleInput)):
if param.value:
inputlayers = param.value.split(';')
if isinstance(param, ParameterMultipleInput):
inputlayers = param.value.split(';')
else:
inputlayers = [param.value]
for inputlayer in inputlayers:
for layer in layers:
if layer.source() == inputlayer:
Expand All @@ -377,7 +380,10 @@ def checkInputCRS(self):
if isinstance(param, (ParameterRaster, ParameterVector,
ParameterMultipleInput)):
if param.value:
layers = param.value.split(';')
if isinstance(param, ParameterMultipleInput):
layers = param.value.split(';')
else:
layers = [param.value]
for item in layers:
crs = dataobjects.getObject(item).crs()
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:
mapLayer = layer.layer()
if mapLayer.type() == QgsMapLayer.VectorLayer:
if shapetype == ALL_TYPES or mapLayer.geometryType() in shapetype:
uri = unicode(mapLayer.source())
if not uri.lower().endswith('csv') and not uri.lower().endswith('dbf'):
vector.append(mapLayer)
if (mapLayer.hasGeometryType() and
(shapetype == ALL_TYPES or mapLayer.geometryType() in shapetype)):
vector.append(mapLayer)
if sorting:
return sorted(vector, key=lambda layer: layer.name().lower())
else:
Expand Down

0 comments on commit 9f8a742

Please sign in to comment.