September 2016
Beginner to intermediate
486 pages
10h 56m
English
The iface class used in the preceding snippets is important in every PyQGIS code; it is used to access most graphical QGIS components, from displayed layers to the toolbar buttons.
The iface class is a Python wrapper for the C++ class, QgisInterface, which is documented at http://qgis.org/api/classQgisInterface.html. Most QGIS classes have a Qgs prefix. Some special classes can have the Qgis or QGis prefixes.
The prefix Qgs is the Qt namespace registered by Gary Sherman, the QGIS creator, so Qt (Q) and Gary Sherman (gs).
The most common use of the iface class is to get a reference of the canvas where maps are displayed:
canvas = iface.mapCanvas()
The class can also be used as a shortcut to load raster or vector layers; ...
Read now
Unlock full access