Wednesday, November 1, 2017

QGIS - Label Multiple Polygons with one attribute text

QGIS Label group of polygons with single text fro the attribute field

Suppose you have a vector layer that contains polygons with the same attribute values as seen below.

You don't want to name each of the polygons because the values are the same, instead you just want one name for the whole group of polygon as seen below...

To achieve this, create a new attribute field in the to control either the label string is turned on/show or off/hide the labels by assigning the value of 1 or 0.

1 is for: On/Show Label
0 is for: Off/Hide Label

Now, after creating the attribute field, take note of the field name and go to the layers label property tab. Define and enable the field label as usual and under: Rendering >> Data Define >> Show Label, select the label control field you created above and save your changes.

All the polygons with the value of "0" will have there labels turned off/hidden only those with value of "1" will be on/showing.

Note: There are many ways to do this, the above is perfect if you want to have control over your label within QGIS map canvas.

That is it.
Thank you for reading.

No comments:

Post a Comment