Skip to content

Commit b3a38f4

Browse files
committedJul 26, 2016
[processing] fix issues with exported layers in GDAL provider
1 parent 6ccf726 commit b3a38f4

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed
 

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
* *
1717
***************************************************************************
1818
"""
19-
from processing.tools import dataobjects
20-
2119

2220
__author__ = 'Victor Olaya'
2321
__date__ = 'August 2012'
@@ -34,6 +32,7 @@
3432
from processing.core.GeoAlgorithm import GeoAlgorithm
3533
from processing.algs.gdal.GdalAlgorithmDialog import GdalAlgorithmDialog
3634
from processing.algs.gdal.GdalUtils import GdalUtils
35+
from processing.tools import dataobjects
3736

3837
pluginPath = os.path.normpath(os.path.join(
3938
os.path.split(os.path.dirname(__file__))[0], os.pardir))
@@ -59,7 +58,7 @@ def processAlgorithm(self, progress):
5958
c = c.replace(layer.source(), exported)
6059
if os.path.isfile(layer.source()):
6160
fileName = os.path.splitext(os.path.split(layer.source())[1])[0]
62-
c = c.replace(fileName, exportedFileName)
61+
c = c.replace(' ' + fileName + ' ', ' ' + exportedFileName + ' ')
6362

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

‎python/plugins/processing/tools/dataobjects.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,7 @@ def exportVectorLayer(layer, supported=None):
290290
settings = QSettings()
291291
systemEncoding = settings.value('/UI/encoding', 'System')
292292

293-
filename = os.path.basename(unicode(layer.source()))
294-
idx = filename.rfind('.')
295-
if idx != -1:
296-
filename = filename[:idx]
297-
298-
filename = unicode(layer.name())
299-
validChars = \
300-
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:'
301-
filename = ''.join(c for c in filename if c in validChars)
302-
if len(filename) == 0:
303-
filename = 'layer'
304-
output = getTempFilenameInTempFolder(filename + '.shp')
293+
output = getTempFilename('shp')
305294
provider = layer.dataProvider()
306295
useSelection = ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED)
307296
if useSelection and layer.selectedFeatureCount() != 0:

0 commit comments

Comments
 (0)