5

I have a road map in QGIS (v 3.22.1). I want to put labels on the roads, but since I get a label on each line segment there will be too many labels when there are many short segments, for example on highway crossing.

Too many "E6" and "E134" - labels

How can I avoid this? I am using a rule based labeling, so I thought

"vegkategori" = 'E' and length($geometry) > 2000

would stop labels on lines shorter than 2000m, but no. ($length neither did work).

Is there some other way of filtering out labels on short lines? - or what would be perfect - a minimum distance between labels on the same data set.

1 Answer 1

8

It is a native feature in QGIS. Select your layer, right-click > Properties > Label. Then select Rendering and scroll down.

You will fine the wanted option (blue color on screenshot). A nice alternative would be to connect lines to prevent unwanted labels (green color on screenshot) Merge connected lines to avoid duplicate labels

qgis label option

1
  • 1
    I had checked Merge connected lines (...) and unchecked the two others, I think itdid not have any effect since in the data layer the road mya be saved as several parallell lines in those problematic cases. The "supress labeling (...)" did save my day. Dec 17, 2021 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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