2

Is it possible to show only every other contour line? And how do you do that?

(I'm new to QGIS Lisboa 1.8.0, but even newer to QGIS Dufour 2.0.1, but have used ArcGIS a bit a while ago, and also some ArcView 3.x earlier. But I'm now using QGIS Dufour 2.0.1. for this).

1
  • 1
    This question has answers in three threads. Although they are not specifically for QGIS, they clearly show how this problem is solved on any platform.
    – whuber
    Commented Jan 31, 2014 at 15:55

1 Answer 1

5

If you have a contour lines layer with associated elevation attribute, you can query the contour lines in reference to the elevation values. More in detail, you could define a rule-based style in Vector properties --> Style in order to query the elevation values you are interested in.

For instance, suppose you have contour lines with equidistance 5 m and you want to show only contour lines with equidistance 10 m. A possible query in a rule-based style could be:

"elev" % 10 = 0

Only the contour lines which match this expression (elev value which ends with 0) will be filtered and consequently shown. Instead, contour lines with elev value which ends with 5 will be hidden (but they are always there).

4
  • 1
    I will also add that if you can, try and have a column with just the elevation numbers as floats or integers. You can then use the mod % operator which is much quicker then a regex. "elev" % 10 = 0 will give you all the 10m lines.
    – Nathan W
    Commented Jan 31, 2014 at 23:13
  • Nathan, you're right! I update the answer considering your suggestion. Commented Feb 1, 2014 at 12:20
  • I used the Epsilon symbol to get to the function window. Every other line was highligthed, but the highlighting stayed on, turning editing on off didnt help. And the intermediate lines was still showing. I went to the atributtable and copied the higeligthed lines to a new layer. It semed to work but the highlighting is still on, how do I turn it of? It migth be som basics Im not familiar with, or someting "that goes without saying" I should have done? Or may be I did something wrong? Commented Feb 3, 2014 at 14:00
  • You don't need to edit the layer, but simply to access to its properties and then set the style, more specifically a ruled-based style. There's a Nathan's post about it. Hope this helps. Commented Feb 3, 2014 at 19:06

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.