QGIS – Changing Text of Individual Labels for Custom Maps

qgisqgis-3

When I have vector layer with several objects and label them, can I change the text of individual labels? I have tried the labeling tools and the tool change label but the field with the label text is grayed out.

Is it possible to change individual label texts?

Best Answer

GIS software isn't really designed for adding custom text annotations that have no connection to the source data attributes.

If you wanted to have totally custom labels for each feature that should be stored in a separate field in your layer (e.g. alt_label as J.R. suggested in the comments).

However some of these other options might help accomplish similar outcomes in some situations:

Label text substitutes You can find this under Labels > Text tab in QGIS 3.x up to 3.8, Labels > Formatting in Q 3.10 onwards. You can import and export lists of substitutions as well to use in various projects.

enter image description here

Using expressions in your text label value Instead of just using a field for your label you can use an expression and add custom rules to add/replace text for a specific feature or class of features as you see fit. Such as

case when "id" < 20000 then 'Not important' else to_string("id")||' (Important!) end

Or

case when "id" = 34565 then 'Special Thing' else "name" end

and so on.

Related Question