Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 e307032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
5 changes: 2 additions & 3 deletions python/plugins/processing/algs/gdal/GdalAlgorithm.py
Expand Up @@ -16,8 +16,6 @@
* *
***************************************************************************
"""
from processing.tools import dataobjects


__author__ = 'Victor Olaya'
__date__ = 'August 2012'
Expand All @@ -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))
Expand All @@ -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)
Expand Down
13 changes: 1 addition & 12 deletions python/plugins/processing/tools/dataobjects.py
Expand Up @@ -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:
Expand Down

0 comments on commit e307032

Please sign in to comment.