TransWikia.com

QGIS Excluding One Variable from Labels

Geographic Information Systems Asked by Ellie Kennedy on June 13, 2021

I am currently labelling a roads map and need help removing the labels for a specific "type" of road.

I apologies for my terminology but I am new to the program.

In my attributes table I have columns "ROAD_NAME" & "ROAD_TYPE" with the latter differentiating between whether the road is a Lane, Highway, Freeway, Street, etc. Some roads are labelled "UNNAMED" in both of these columns. On our other system these roads are present on the map but have no naming.

I currently have applied the rule – "ROAD_NAME || ‘ ‘ || ROAD_TYPE" and merged the lines, which has worked well for the other roads but has the UNNAMED roads labelled with "UNNAMED".

I would like the UNNAMED roads still visible on the map but I want the label to disappear.

enter image description here

2 Answers

you can add an if clause to your label statement:

if("ROAD_NAME"='UNNAMED','',"ROAD_NAME" || ' ' || "ROAD_TYPE")

or alternativly use rule based labeling, where your rule would be:

"ROAD_NAME"<>'UNNAMED'

Answered by eurojam on June 13, 2021

Simply you can disable the labeling of 'UNNAMED' from Layer Properties -> Labeling -> Rendering -> Show Label under Data defined then Edit:

enter image description here

Write the following:

"ROAD_TYPE" != 'UNNAMED'

All the labels of road type that is unnamed will be disabled.

Answered by ahmadhanb on June 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP