Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

share|improve this question

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.

share|improve this answer
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 Nov 19 '12 at 21:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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