5

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

6

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.

5

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'

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.