Graphics Reference
In-Depth Information
Summary
In this chapter, we delved into the topic of QGIS plugin programming. We created two sep-
arate plugins, a simple one to get started with, and a more complex and useful plugin that
displays information about a clicked-on feature's geometry. We also looked at the QGIS
plugin architecture, the plugin development process, and some of the possibilities and lim-
itations of QGIS plugins. Along the way, we learned about the tools needed to develop
QGIS plugins, discovered that plugins are simply Python packages with certain special
files in them, and saw how the PyQt command-line tools can be used to compile user-inter-
face templates and resource description files into Python modules so that they can be used
within a plugin.
We also looked at how your plugin is integrated into the QGIS user interface using icons
and menu items, how to run your plugin, and what happens when your plugin crashes. We
also looked briefly at the Plugin Builder, and how it can be useful.
Next, we looked at how to use a Makefile to automate plugin compilation and deployment,
and the typical write-make-reload-test cycle used to develop plugins. We saw how to write
and use HTML help files within your plugin, how unit tests can be used for QGIS plugins,
and how to distribute your plugin, both to the official QGIS plugin repository and to a re-
pository that you set up yourself.
We learned that there are many things you can do with plugins, including drawing into the
map canvas, creating custom layers, intercepting QGIS actions, programmatically creating
map layers, and composing complex maps. At the same time, we saw that there are some
constraints in what a QGIS plugin can do, including the need to share the QGIS user inter-
face with all other plugins, the inability to create turnkey mapping applications, compatibil-
ity issues, and difficulties in using some third-party Python libraries.
In the next chapter, we will look at the process of using the PyQGIS libraries within your
own external Python programs. This gets around many of the limitations of a QGIS Plugin,
at the cost of some additional complexity.
Search WWH ::




Custom Search