mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[processing] fix substitution of the original layers in GDAL commands
This commit is contained in:
parent
2466083790
commit
89774abed3
@ -26,6 +26,7 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
@ -58,7 +59,9 @@ class GdalAlgorithm(GeoAlgorithm):
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user