Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

How would I go about labelling every other feature in QGIS (1.8)?

For example I have a set of contours every 10meters from 0m to 100m. How would I label only every 20meter contour? e.g. label contours 0, 20, 40, 60, 80 and 100m while showing all the contours.


share|improve this question
In ArcGIS, I have used a mod() query to select the contours I wanted to label, and then labeled only the selected features. This should be possible in QGIS too. Syntax for the query should be something like mod('elev',20)=0 where 'elev' is the contour value. – L_Holcombe Feb 26 '13 at 6:23

According to the question

I think following steps will be helpful for you..

1.Select the features you want to label

2.Open attribute table

3.If you don’t have label attributes ready yet: Add two type “real” columns called e.g. “label_x” and “label_y”

4.Invert the selection (3rd button in attribute table window)

5.Open field calculator and fill “label_x” and “label_y” fields of the selected features with 0 values (or any coordinates outside your map extent)

6.Close field calculator and attribute table

7.Save your edits

8.Open the labeling dialog and set “data defined settings” – “x coordinate” and “y coordinate”

9.Enable “Label this layer” and specify the label field


For details please visit our admin (@Underdark) blog

share|improve this answer
Thanks, much appreciated. – Geezer Oct 14 '13 at 10:04

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.