How to manage space in between labels (or density)?

I would like to have less labels in order to have more space in between. The label order is not important.

I would like to precise is just for city name labels, not street name or like.

A picture is better than a long explanation :

enter image description here


enter image description here

  • Just to clarify: You want to label cities. Not all of them but some random ones? Isn't there some classification in your data which can be used to label only the bigger/important ones? – underdark May 4 '15 at 16:13
  • Classification is OSM one (town, city, village). So around PARIS many are city. Label tool show them all and avoid the overlap of course. But for my need I need more 'air' in between labels. This mean less label with more space around. If they where an option, it would be "Blank space Y/X around the label" – Mathieu May 5 '15 at 16:50

Use an expression like

'\n\n\n' || name || '                    '

It adds some empty lines in the beginning and extra spaces to the end which are respected by the QGIS labeling engine when it computes collisions.

enter image description here

It's a horrible hack but i works kind of

enter image description here

  • 1
    Can you be more precise how to use this hack. I'm not so good in QGIS expression... – Mathieu May 9 '15 at 15:21
  • SUPER ! Can you explain what is does in human language ? – Mathieu May 9 '15 at 15:51
  • I understand the hack. But as you see I use also label background, and this affect the background :-( – Mathieu May 9 '15 at 16:04
  • 1
    Ok I adjust the X/Y size from background and also I change you hack like this = '\n'|| ' ' || name ||' '|| '\n' because my text is centered. You very clever this is a Nice Hack !!! – Mathieu May 9 '15 at 16:12
  • 1
    You can fine tune the hight using the line heigth. For horizontal is ok. – Mathieu May 9 '15 at 16:16

Here are a few indications that could help :

In the Layer properties select the Label Tab. In the Rendering subpage (rendu in french) on the right you can param a few things.

For example, limit the amount of Labels to be printed or merge connected line labels

The placement of labels can be customized under the Placement (Emplacement) subpage.

You can also look at docs

  • THX, the amount of label will not fit to our need. Customizing placement either (we are not dealing with a small locality but with Europe map, so need a global solution). What do you mean by "merge connected line labels" ? The great option will be like "leave x mm space around label".... – Mathieu Apr 26 '15 at 10:41
  • "merge connected line labels" doesn't exist anymore in 2.8.1 – Mathieu Apr 29 '15 at 8:57
  • @Mathieu To fit our focussed Q&A format can you consider using the edit button beneath your question to revise it with any additional information, please? I recommend taking the Tour, if you have not already. – PolyGeo May 2 '15 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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