Creating a traditional QGIS plugin

Plugins are the best way to extend QGIS, as they can be easily updated and reused by other people. And as we'll see throughout this book, you can use Python to create plugins. When you create a Python-based plugin, you can usually access that plugin's functionality through the PyQGIS API.

Getting ready

The easiest approach to creating a plugin is to use the Plugin Builder plugin to jump-start development. You can find it in the main QGIS plugin repository and install it.

How to do it...

Perform the following steps to create a simple plugin that displays a dialog box with a custom message:

  1. Start QGIS.
  2. From the Plugins menu, select Plugin Builder and then click on Plugin Builder in the submenu.
  3. In the QGIS Plugin Builder ...

Get QGIS Python Programming Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.