“The Inverted Polygon Renderer is used to render outside of the polygons defined in your vector polygon layer.”
In this module we will explore the inverted polygon renderer. There are two primary uses for this renderer: masking and graduated outlines which extend away from polygons rather than into them.
Goal: To learn how to create a coastline effect around country polygons.
Check your results:
Once you have finished, you should have the interior of your country boundaries transparent, the exterior filled with a pleasing sea colour.
Try put another layer behind the countries and verify that you can see through the interior of the countries
Name | Expectation |
---|---|
Layer |
countries from ne.sqlite |
Renderer |
Inverted polygons |
Sub renderer |
Single symbol |
Symbol layer 1: |
|
Symbol layer type |
Simple fill |
Fill style |
no brush |
Border width |
1 mm |
Symbol layer 2: |
|
Sub layer type |
Shapeburst fill |
Gradient colours |
Two colours |
|
|
Shading style |
Shade to set distance 5mm |
Blur strength |
10 |
One useful thing you can do with the inverted polygon render is feature masking. For example if you are trying to make a map of your country, and want to exclude surrounding territories you can create a copy of your country layer filtered to your focus country and then use the inverted polygon renderer to hide all countries except the focus country. One gotcha with this is that labels will not be masked (as of QGIS 2.14 and below). You can do some clever tricks to mask the labels which we will look at in the expressions module - see also the Mask plugin which makes it easier to manage label masking in your expressions.
Use the inverted renderer when:
Inverted rendering can be used with:
Download the sample data for the lesson.