5

I have a contour vector layer with a step 0.2m . I want every 1 metre, to change the line style, a thicker line for example, and the rest of them,symbolize with a dotted style. So, I can do it manually, categorize the layer, and at each metre,change the style, or I can copy the file, paste it and delete all the Real numbers, leave the integers only, and style them as I like and put the layer over the original. My question is if I can do the same job with the "Rule-base" style. If there is a formula which can locate the integer numbers and make them a category, so I can finish my job quicker.

underdark
  • 84,148
  • 21
  • 231
  • 413
Pitheas
  • 741
  • 3
  • 15

1 Answers1

11

Try to do the following formula at Rule-based Style

"FieldName" % 1 = 0    (Assign thick lines for 1 meter interval lines)
ELSE                   (Assign thin lines or any other style for other interval lines)

enter image description here

In the above image "Elevation" is the name of the field that holds the contour elevation.

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105