I'm new to Qgis. I have a script that runs successfully inside the Qgis editor, but it fails outside. It returns the alghelp, but fails on running the actual tool so it seems I have the external IDE communicating with modules properly. Ideas?
import sysimport osfrom qgis.core import *QgsApplication.setPrefixPath(r'C:\OSGeo4W64\bin', True)app = QgsApplication([], True)import processingfrom processing.core.Processing import ProcessingProcessing.initialize()alg = 'saga:fillsinksxxlwangliu'processing.alghelp(alg)srcDir = r'G:\stest'for e in os.listdir(srcDir): if e.endswith('.tif'): print 'Processing ' + e processing.runalg(alg, srcDir + os.sep + e, 0.025, srcDir + os.sep + e[:-4] + 'filled.tif')app.exit()QgsApplication.exitQgis()the traceback is
: 'NoneType' object has no attribute 'crs'
أكثر...
import sysimport osfrom qgis.core import *QgsApplication.setPrefixPath(r'C:\OSGeo4W64\bin', True)app = QgsApplication([], True)import processingfrom processing.core.Processing import ProcessingProcessing.initialize()alg = 'saga:fillsinksxxlwangliu'processing.alghelp(alg)srcDir = r'G:\stest'for e in os.listdir(srcDir): if e.endswith('.tif'): print 'Processing ' + e processing.runalg(alg, srcDir + os.sep + e, 0.025, srcDir + os.sep + e[:-4] + 'filled.tif')app.exit()QgsApplication.exitQgis()the traceback is
: 'NoneType' object has no attribute 'crs'
أكثر...