12

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.

2
  • Yes I'm not getting this to work either... Commented Sep 27, 2016 at 17:47
  • 1
    Yeah...I don't think there's a lot of information out there regarding this except for this tweet
    – Joseph
    Commented Sep 28, 2016 at 11:48

2 Answers 2

5

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:

  1. Without using blocking option, the labels will look like this:

enter image description here

  1. With using blocking option, the labels will look like this, especially those marked with red rectangles:

enter image description here

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.

2
  • Thanks for checking it out. I'm noticing what you describe. Would love to have a feature comparable to arcmap's label weights where you can completely prevent labels from overlapping polygon edges or interiors.
    – Galen
    Commented Oct 6, 2016 at 18:09
  • "Blocking" is more absolute than "discourage", I think the name should not have been changed given the functionality that it enables. Commented Oct 16, 2016 at 21:13
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.