Sextante is addressable via python using the QGIS python console (unfortunately not from outside QGIS). I´m writing a standalone app and want to include Sextante geoprocessing functionality. In QGIS python console this is working perfectly. Is it possible to address the console from an outside python script (standalone app)?
My code so far:
import sys, os
from PyQt4.QtGui import QApplication, QAction, QMainWindow
from PyQt4.QtCore import SIGNAL, Qt, QString
app = QApplication(sys.argv)
from qgis.core import *
import qgis.utils
import qgis.gui
QgsApplication.setPrefixPath("C:/OSGeo4W/apps/qgis")
QgsApplication.initQgis()
sys.path.append("C:/Users/.../.qgis/python/plugins")
sys.path.append("C:/OSGeo4W/apps/qgis/python/plugins")
sys.path.append("C:/Users/.../.qgis/python/plugins/sextante")
import sextante
sextante.core.Sextante.Sextante.initialize()
map = qgis.gui.QgsMapCanvas()
layer = QgsVectorLayer("D:/Python_Test/a.shp",'a','ogr')
QgsMapLayerRegistry.instance().addMapLayer(layer)
map.setExtent(layer.extent())
map.setLayerSet( [ qgis.gui.QgsMapCanvasLayer(layer) ] )
output = "D:/Python_Test/b.shp"
sextante.runalg("qgis:convexhull",layer,None,None,output)
QgsApplication.exitQgis()