Last active
August 6, 2018 17:43
-
-
Save jenningsanderson/8940410 to your computer and use it in GitHub Desktop.
Custom Initialization for running standalone PyQGIS processing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Standalone QGIS Initilization Script for QGis running on Mac OS X | |
''' | |
import os | |
import sys | |
#Implicitly define where plugins are for QGIS | |
sys.path.append('/Applications/QGis.app/Contents/Resources/python/') | |
sys.path.append('/Applications/QGis.app/Contents/Resources/python/plugins') | |
#Import QGIS | |
from qgis.core import * | |
#If we don't initialize the app, it will crash | |
app = QgsApplication([],True) | |
QgsApplication.setPrefixPath(r"/Applications/QGIS.app/Contents/Plugins", True) | |
QgsApplication.initQgis() | |
import PyQt4 | |
from PyQt4 import QtCore, QtGui | |
#Most important module: | |
import processing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment