Skip to content

Commit cc50157

Browse files
committedApr 7, 2016
[processing] make gdal algorithms honor selection
fixes #14622
1 parent bf3f8b5 commit cc50157

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎python/plugins/processing/algs/gdal/GdalAlgorithm.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* *
1717
***************************************************************************
1818
"""
19+
from processing.tools import dataobjects
1920

2021

2122
__author__ = 'Victor Olaya'
@@ -47,7 +48,15 @@ def getCustomParametersDialog(self):
4748
return GdalAlgorithmDialog(self)
4849

4950
def processAlgorithm(self, progress):
50-
GdalUtils.runGdal(self.getConsoleCommands(), progress)
51+
commands = self.getConsoleCommands()
52+
layers = dataobjects.getVectorLayers()
53+
for i, c in enumerate(commands):
54+
for layer in layers:
55+
if layer.source() in c:
56+
c = c.replace(layer.source(), dataobjects.exportVectorLayer(layer))
57+
58+
commands[i] = c
59+
GdalUtils.runGdal(commands, progress)
5160

5261
def shortHelp(self):
5362
return self._formatHelp('''This algorithm is based on the GDAL %s module.

0 commit comments

Comments
 (0)
Please sign in to comment.