Skip to content
Permalink
Browse files

[processing] fix substitution of the original layers in GDAL commands

  • Loading branch information
alexbruy committed Sep 14, 2016
1 parent 2466083 commit 89774abed3740426d8aee4a8413c3a05ec705cad
Showing with 4 additions and 1 deletion.
  1. +4 −1 python/plugins/processing/algs/gdal/GdalAlgorithm.py
@@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

import os
import re

from qgis.PyQt.QtGui import QIcon

@@ -58,7 +59,9 @@ def processAlgorithm(self, progress):
c = c.replace(layer.source(), exported)
if os.path.isfile(layer.source()):
fileName = os.path.splitext(os.path.split(layer.source())[1])[0]
c = c.replace(' ' + fileName + ' ', ' ' + exportedFileName + ' ')
c = re.sub('[\s]{}[\s]'.format(fileName), ' ' + exportedFileName + ' ', c)
c = re.sub('[\s]{}'.format(fileName), ' ' + exportedFileName, c)
c = re.sub('["\']{}["\']'.format(fileName), "'" + exportedFileName + "'", c)

commands[i] = c
GdalUtils.runGdal(commands, progress)

0 comments on commit 89774ab

Please sign in to comment.
You can’t perform that action at this time.