Develop your QGIS plugin

Licencia (CC BY-SA 3.0)

III QGIS User Conference
7 August 2017 - Nødebo

Luigi Pirelli


Who am I

15 years working on Satellite Ground Segments for

Landsat, Cryosat, MODIS, Sentinel...


Since 2006 in QGIS/GRASS

QGIS Plugin y Core developer



Since 2015 part of Boundless Desktop Team

Commercial solution base on QGIS (and more)



Founder of

Italian OSGEO Local Chapter

Coautor of "Mastering QGIS"


QGIS Python Programming Cookbook

More PyQGIS books




docker pull kartoza/qgis-desktop

docker pull kartoza/qgis-server


Example data:


Free as Freedom - mainly GPL2

Open - Anyone can participate

Trasparent - PSC coordination list is also open

How to Participate

Issues -

Helps - In ML o en freenode #qgis channel

Bug fix:

Translates -

other languages e.g QGIS-es:


but best part is particpating to...


every 6 months

When your user group?

Having right vote on using QGIS funds... and more


QGIS is wrote in:

C++ (almos all)

Python (some core plugins)

Javascript (some parts in Plugin Manager)

C++ -

Python -



Ask help to the QGIS

The core Python console


IPython Console plugin

by A.Pasotti

  • Exploring commands
    • help(...)
    • dir(...)
  • To test command
  • To test code

Help each other

Ice break

coding in python console


95% of C++ API can be accessed by Python thanks to SIP wrappers


PyQGIS Cookbook


The better school is to install end read plugins code

Let's build a plugin

with QGIS Plugin Builder (versión 2.16)

What we need

  • Python editor (vi, Atom, Eric4, Eclipse, PyCharm,...)
  • Optional: if we need Graphical User Interface (GUI)
    • *.ui file editors (Qt Creator, Qt Designer)
    • Resource builder pyrcc4 (pyqt4-dev-tools)
  • Optional:
    • project builder "make" (build-essential)



  • Import plugin code project


  • Plugin structure


  • add instruction in


  • Do debug


A simple run() code

Plugins for QGIS2 and QGIS3

Luigi Pirelli




Licence: (CC BY-SA 3.0)

QGIS User Conf: PyQGIS - Develop your QGIS plugin

By Luigi Pirelli

QGIS User Conf: PyQGIS - Develop your QGIS plugin

Training to introduce in the QGIS Plugin development in Python using PyQGIS. Topics are: • Really short introduction into python (if necessary) and Class concept • Orienteering inside community resources for problem solving • How to configure a Development and debug environment • Introduction to PyQGIS, example to manage raster and vectors • How to run processing toolbox algorithm and integrate new ones • Anatomy of a QGIS plugin • Write simple plugin • Tips&Tricks to develop a plugin compatible with QGIS3 and QGIS2 Training condition: – Training duration would be of 4h – Would facilitate to do it on OSGeoLive latest version + dev tools e.g * 10.5 => QGIS 2.14 * (if available in august) 11 => QGIS 2.18 QGIS version is not critical for this training. Training can be done also not on OSgeoLIve platform leaving attenders to choose platform. In that case it’s necessary to have QGIS already installed + some dev tools. – Would speedup training a attender selection with a basic python knowledge, but it’s not strictly necessary

  • 2,802