I have the following attribute. I would like QGIS to prioritise only the maximum value from field1
while labelling. In other words, on the figure 2 (zoomed out version of figure 1), I would like to label 9.9, 8 and 5.4 rather than how QGIS priortised the lower value in QGIS 3.16.
1 Answer
In the "Placement" tab of the label setting there is a "priority" setting for label. by using data defined override you can give higher priority to label with higher value simply by using your field as expression (so the label "9.9" will get a 9.9 priority and will get render rather than label with lower priority/value)
EDIT : To reverse the order you just need to multiply by minus 1.But you may also use an expression to set any order you may find useful.
For exemple if you want to get the middle value prioritized you may create an expression that reclass the value by attributing an higher priority to the middle value :
CASE WHEN "field1" >2 and "field1" <5 THEN 10 ELSE 0 END
This expression will give the highest priority (10) to value between 2 and 5 and the lowest (0) to other value. In your case it will display 3 and 4.1 before the other value. This way of reclassifying is also the way to go if you need to prioritize with a non numeric field
-
that was useful. What if I would like to do other way around prioritise 3, 4.1 etc ., over 9 (to prioritise the lowest value first)?– RajFeb 1, 2022 at 17:41
-
-
1