We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Seven ways of injecting Python to QGIS

Formal Metadata

Title
Seven ways of injecting Python to QGIS
Title of Series
Number of Parts
188
Author
License
CC Attribution 3.0 Germany:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language
Producer
Production Year2014
Production PlacePortland, Oregon, United States of America

Content Metadata

Subject Area
Genre
Abstract
This presentation will enlighten the novice Python QGIS user with different ways of running Python code in QGIS without the need of building a QGIS Python plugin. Any QGIS user could start writing small Python scripts for automating, customizing and extending QGIS, making their daily workflow an easier and more fun task to complete.-Python through the QGIS Python Console and Script editor: This would be the most obvious place for PyQGIS newcomers. The console and editor comes with syntax highlighting, autocomplete and easy integration to QGIS.-Scriptrunner: A handy plugin for running Python scripts when objects needs to be instantiated.-Extending the Expression engine: Using a startup.py in your .qgis2 Python folder with a @qgsfunction(0, "Python") attribute. An example is shown adding the name of the current user, to a label on a Print Composer composition.-Run script on project event open, close and save: You may want to validate if a certain table is open, and notify the user if it is not, when opening or saving a QGIS project.-Python in QGIS Actions: Extend your QGIS actions with Python code. -Python Init function: A powerful feature in QGIS when creating new features. You can validate and programmatically edit your attribute input. One can also process the newly digitalized geometry. An example is shown creating rectangular oil tanks with predefined dimension.-Processing Framework: Scripting methods from the Processing Framework. Useful when you need to loop or run a batch of commands from the Processing Framework.
Keywords