Skip to content
Permalink
Browse files

[processing] fix issues with exported layers in GDAL provider

(cherry picked from commit b3a38f4)
  • Loading branch information
alexbruy committed Jul 26, 2016
1 parent 73c0128 commit e3070323ab8a884692925a8b6150f5fa76ccb1ee
@@ -16,8 +16,6 @@
* *
***************************************************************************
"""
from processing.tools import dataobjects


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

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))
@@ -59,7 +58,7 @@ 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 = c.replace(' ' + fileName + ' ', ' ' + exportedFileName + ' ')

commands[i] = c
GdalUtils.runGdal(commands, progress)
@@ -290,18 +290,7 @@ def exportVectorLayer(layer, supported=None):
settings = QSettings()
systemEncoding = settings.value('/UI/encoding', 'System')

filename = os.path.basename(unicode(layer.source()))
idx = filename.rfind('.')
if idx != -1:
filename = filename[:idx]

filename = unicode(layer.name())
validChars = \
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:'
filename = ''.join(c for c in filename if c in validChars)
if len(filename) == 0:
filename = 'layer'
output = getTempFilenameInTempFolder(filename + '.shp')
output = getTempFilename('shp')
provider = layer.dataProvider()
useSelection = ProcessingConfig.getSetting(ProcessingConfig.USE_SELECTED)
if useSelection and layer.selectedFeatureCount() != 0:

0 comments on commit e307032

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