Book Image

Building Mapping Applications with QGIS

By : Erik Westra
Book Image

Building Mapping Applications with QGIS

By: Erik Westra

Overview of this book

Table of Contents (16 chapters)
Building Mapping Applications with QGIS
About the Author
About the Reviewers
Free Chapter
Getting Started with QGIS

Working with symbol layers

In the previous chapters, we created symbols to display vector features by instantiating one of the three basic subclasses of QgsSymbolV2:

  • QgsMarkerSymbolV2 for point geometries

  • QgsLineSymbolV2 for line geometries

  • QgsFillSymbolV2 for polygon geometries

We did this either by calling one of the preceding class's static createSimple() methods, or by asking the QgsSymbolV2 class to provide us with the default symbol for a given type of geometry. Irrespective of how we did it, the result was a ready-to-use symbol object that displays a given type of vector geometry.

Internally, symbols consist of one or more symbol layers that are displayed one on top of the other, to draw the vector feature:


The symbol layers are drawn in the order in which they are added to the symbol. So, in this example, Symbol Layer 1 will be drawn before Symbol Layer 2. This has the effect of drawing the second symbol layer on top of the first. Make sure you get the order of your symbol layers...