O'Reilly logo

Building Mapping Applications with QGIS by Erik Westra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a useful plugin

Let's now apply the knowledge we've gained to build a plugin that does something useful and interesting. While there are built-in tools in QGIS to query a feature and identify the feature's attributes, there is no easy way of getting information about the geometry associated with a feature. So let's write a plugin that lets the user click on a feature and display various statistics about that feature's geometry.

We're going to call our new plugin Geometry Info. When the user clicks on our plugin's toolbar icon, we will activate a map tool that listens for mouse clicks on the map canvas. When the user clicks on the map canvas, we'll find the feature that the user clicked on, and calculate and display statistics about that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required