Does anyone know how the 'Blocking' label style in QGIS 2.16 works? I've got a polygon boundary layer and would like to keep any labels from overlapping the outline. I've turned blocking on for the polygon, but none of the labels seem to change.
I tested the blocking option, using QGIS 2.16.2, to block labels that are located at the edge of the polygon boundary. Actually it works, but it seems it works if the labels are located close to the edge of the polygon layer.
To illustrate the difference of using the blocking option and not using the blocking option, I will use two shapefiles: the world boundary shapefile and the major city shapefile.
First, we need to show the labels of major city shapefile and use the world boundary polygon to block the labels.
Here is the difference:
- Without using blocking option, the labels will look like this:
- With using blocking option, the labels will look like this, especially those marked with red rectangles:
If the labels of major city shapefile are located very close to the edge of the polygon boundary shapefile (world boundary), the labels will be blocked from covering the edge of the polygon boundary, but if the labels of major city are located a little bit far from the edge of the polygon boundary, the influence of blocking will have a minimum effect or no influence at all.
Another point is, blocking option was available in the previous version of 2.14, but with different name "Discourage other labels from covering features in this layer". I think the developer team changed the name to make it shorter and to give more descriptive meaning to its function.
It seems to me that this feature is buggy. I noticed that the result depends on the 'placement' settings for the labels:
- offset from centroid / around centroid: blocking areas are ignored
- horizontal / free / using perimeter: blocking areas are respected
My test setup:
- a polygon layer containing one polygon, labels set to 'blocking'
- another polygon layer with a few polygons, labels enabled & then using different 'placement' options
I filed a bug report: https://hub.qgis.org/issues/15718