mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[processing] some SAGA fixes
-fixed raster export -fixed version numbering when no saga installation is found
This commit is contained in:
parent
5511c86c9f
commit
e9228b67c9
@ -304,8 +304,12 @@ class SagaAlgorithm212(GeoAlgorithm):
|
||||
def exportRasterLayer(self, source):
|
||||
global sessionExportedLayers
|
||||
if source in sessionExportedLayers:
|
||||
self.exportedLayers[source] = sessionExportedLayers[source]
|
||||
return None
|
||||
exportedLayer = sessionExportedLayers[source]
|
||||
if os.path.exists(exportedLayer):
|
||||
self.exportedLayers[source] = exportedLayer
|
||||
return None
|
||||
else:
|
||||
del sessionExportedLayers[source]
|
||||
layer = dataobjects.getObjectFromUri(source, False)
|
||||
if layer:
|
||||
filename = str(layer.name())
|
||||
|
@ -42,7 +42,6 @@ from processing.tools.system import *
|
||||
|
||||
sessionExportedLayers = {}
|
||||
|
||||
|
||||
class SagaAlgorithm213(SagaAlgorithm212):
|
||||
|
||||
OUTPUT_EXTENT = 'OUTPUT_EXTENT'
|
||||
@ -225,11 +224,15 @@ class SagaAlgorithm213(SagaAlgorithm212):
|
||||
def exportRasterLayer(self, source):
|
||||
global sessionExportedLayers
|
||||
if source in sessionExportedLayers:
|
||||
self.exportedLayers[source] = sessionExportedLayers[source]
|
||||
return None
|
||||
exportedLayer = sessionExportedLayers[source]
|
||||
if os.path.exists(exportedLayer):
|
||||
self.exportedLayers[source] = exportedLayer
|
||||
return None
|
||||
else:
|
||||
del sessionExportedLayers[source]
|
||||
layer = dataobjects.getObjectFromUri(source, False)
|
||||
if layer:
|
||||
filename = str(layer.name())
|
||||
filename = layer.name()
|
||||
else:
|
||||
filename = os.path.basename(source)
|
||||
validChars = \
|
||||
|
@ -102,7 +102,8 @@ class SagaAlgorithmProvider(AlgorithmProvider):
|
||||
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
|
||||
self.tr('Could not open SAGA algorithm: %s\n%s' % (descriptionFile, str(e))))
|
||||
def getDescription(self):
|
||||
return 'SAGA (%s)' % SagaUtils.getSagaInstalledVersion()
|
||||
version = SagaUtils.getSagaInstalledVersion()
|
||||
return 'SAGA (%s)' % version if version is not None else 'SAGA'
|
||||
|
||||
def getName(self):
|
||||
return 'saga'
|
||||
|
@ -27,7 +27,6 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
import os
|
||||
import stat
|
||||
import traceback
|
||||
import subprocess
|
||||
from PyQt4.QtCore import *
|
||||
from qgis.core import *
|
||||
|
Loading…
x
Reference in New Issue
Block a user