I just imported original OSM data to export a pdf-map by assigning graphic attributes to the features I need.

The label tool in QGIS 1.8 allows to select certain features, like I can do with the graphic style. But I do not know and can not find how to label a feature like ref (street-nr) of a certain tag like highway = motorway (especially if all other line elements are labeled by name).

tags LIKE '%"highway"="motorway"%'

and then? ref is a feature with an attribute in the column tags.

Another Example: Can I achieve several labeling sizes for different tags like city, town or suburb?

The old labeling menu allows only one label attribution for each layer. Can I select labeling by any attribute?

Thanks for any help and tips concerning the syntax in QGIS attribution and labeling. (The answer: "How to label features in QGIS using SQL statement?" did not help at least)

1 Answer 1


Using expression-based labeling and CASE WHEN THEN constructs, it should be possible to achieve what you are looking for:

enter image description here

Different label sizes are currently only possible if you define the label size in attributes and use data-defined labeling.

  • Ok, thanks. But I could not work out the syntax. The function help list in QGIS 1.8 is empty: "(Hoppla! QGIS kann die Hilfe für die Funktion nicht finden Die Hilfedatei für Operatoren wurde nicht gefunden. Sie war weder in Ihrer (de_DE) noch in englischer Sprache verfügbar. Wenden Sie sich an das QGIS-Entwicklerteam, falls Sie eine ergänzen möchten.)" I was not able to sort out, how to define to use the "ref"="A 1" tag from "tags" when "highway"="motorway"
    – robert-t
    Commented Nov 19, 2012 at 21:55

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.