2

I have a table with a lot of place names. There are much too many names for all of them to be shown on the print composer map. Some names are important, and in the column fontsize these have a bigger font size number (for instance 270). I want to prioritize bigger font size names over smaller font size names. So I go to Layer Properties -> Labels -> Placement -> and in Priority chose a data defined override by selecting the field fontsize .

Should this work? It does not give rational results, as some smaller labels are still shown instead of bigger ones.

Qgis version 2.18.7

closed as unclear what you're asking by underdark Jun 6 '17 at 19:28

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • How about using Label z-index along with associated data defined override to assign the font size as control? – Kazuhito May 31 '17 at 14:34
  • Can you provide examples? – underdark May 31 '17 at 18:23
1

If you want to disable completely from showing small labels, you can use Properties -> Labels -> Render -> Show labels and write the following formula:

CASE WHEN 
"fontsize" <> 270 THEN NULL
Else "Name"
END

Where "Name" is the field name that contains the names you want to show.

enter image description here

Do not forget to use Label with "Name" or the suitable field name that shows the names.

In the following example, I am showing only the Ids that their font size bigger than 50 stored in a field name "Num"

enter image description here

  • Thank yoy @ahmadhanb , I do need to show also small labels if there is space enough for them, but I need big labels to always be prioritized over smaller ones. – Benjamin Donner May 31 '17 at 8:31
  • 1
    @BenjaminDonner How do you define the "enough space"? I think the spaces among the labels are different. – ahmadhanb May 31 '17 at 8:59

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