Skip to content

Commit 35c01f8

Browse files
volayaalexbruy
authored andcommitted
[processing] make gdal algorithms honor selection
fixes #14622 (cherry picked from commit cc50157)
1 parent f412187 commit 35c01f8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

+10-1
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)