Skip to content
Permalink
Browse files

[sextante] fixed problem when exporting non-file based data to be use…

…d by 3rd party apps
  • Loading branch information
volaya committed Apr 17, 2013
1 parent cf8f8c3 commit 06d20455f5aa80b1ec259d702d574a24de597834
Showing with 8 additions and 2 deletions.
  1. +8 −2 python/plugins/sextante/core/LayerExporter.py
@@ -49,12 +49,18 @@ def exportVectorLayer(layer):
It also export to a new file if the original one contains non-ascii characters'''
settings = QSettings()
systemEncoding = settings.value( "/UI/encoding", "System" ).toString()

filename = os.path.basename(unicode(layer.source()))
idx = filename.rfind(".")
if idx != -1:
filename = filename[:idx]
output = SextanteUtils.getTempFilenameInTempFolder(filename + ".shp")
#output = SextanteUtils.getTempFilename("shp")

filename = str(layer.name())
validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:"
filename = ''.join(c for c in filename if c in validChars)
if len(filename) == 0:
filename = "layer"
output = SextanteUtils.getTempFilenameInTempFolder(filename + ".shp")
provider = layer.dataProvider()
useSelection = SextanteConfig.getSetting(SextanteConfig.USE_SELECTED)
if useSelection and layer.selectedFeatureCount() != 0:

0 comments on commit 06d2045

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