From 43b5c9d10f9ee81157afa68510c63ee5580f5d2e Mon Sep 17 00:00:00 2001 From: Alireza Adli Date: Thu, 14 Dec 2023 13:26:42 -0500 Subject: [PATCH] Add gitignore & pyqgis boilerplate --- .gitignore | 6 ++++++ standalone_vs.py | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 standalone_vs.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d6bb3f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Folders +data/ +ignored_data/ + +# Python Modules +standalone_charm.py diff --git a/standalone_vs.py b/standalone_vs.py new file mode 100644 index 0000000..cb08a75 --- /dev/null +++ b/standalone_vs.py @@ -0,0 +1,25 @@ +""" +Alireza Adli +Working with PyQGIS Standalone. +The preliminar codes and comments comes from the PyQGIS cookbook +""" + +from qgis.core import * + +# Supply the path to the qgis install location +QgsApplication.setPrefixPath(prefixPath='C:/Program Files/QGIS 3.34.1/apps/qgis', useDefaultPaths=True) + +# Create a reference to the QgsApplication. +# Setting the second argument to True enables the GUI. We need +# this since this is a custom application. +qgs = QgsApplication([], False) + +# load providers +qgs.initQgis() + +# Write your code here to load some layers, use processing +# algorithms, etc. + +# Finally, exitQgis() is called to remove the +# provider and layer registries from memory +qgs.exitQgis() \ No newline at end of file