[GIS] How to keep labels in the same layer from overlapping in QGIS

labelingqgis

In QGIS (2.14.0) I have a polygon layer I need to show labels for, but often the polygons overlap. I need to see the labels for each of the overlapping parts but when the two polygons are coincident, the label gets placed in the same location and overlaps one another.

For example, polygon A is 50m^2 and is labelled "A", polygon B is also 50m^2 and coincident with polygon A but is labelled "B". Currently I get both "A" and "B" rendering on top of each other whereas i want "A" and "B" to render without colliding, so both are readable.

In the image below the three south western parcels each have "2-Ground Oriented Infill" and "17-Coach Houses" overlapping polygons, but labeling engine has drawn "17" first on one feature and "2" first on the other, so they look mismatched but should all be the same according to the polygon colour, ideally both "2" and "17" labels should show and not overlap. The south eastern polygon doesn't overlap as "7-Riparian Areas" is a different polygon shape than the overlapped "17-Coach Houses" in that case".

Best Answer

I ended up using a workaround by forcing the labels into separate layers. First I duplicated the layer in question several times so that i had one copy for every label type required (ie. each unique value in an attribute). then I filtered each layer to just the necessary value and labelled it. In each layer the properties were set to display colliding labels, etc.

The benefit of all this was not just that the labels move around each other because they are in different layers, but i can also now label each value slightly differently instead of all the same text.

A bit klunky, and only really useable if there are not a ton of unique values, but it worked.