I have a shape of contour lines that I need to filter using the Height Above Sea Level like this: contour lines from 500 to 1200 and from 2000 to 2500.

I can do it in several steps generating a shape using the first condition and another shape using the second, and finally combining them using these expressions:

  • "ALTURA_SOB" >= 500 AND "ALTURA_SOB" <= 1200
  • "ALTURA_SOB" >= 2000 AND "ALTURA_SOB" <= 2500

Nevertheless, I want to know if there is a way to do it in one step using the "Select by Expression" tool?

1 Answer 1


Use this expression:

("ALTURA_SOB" >=500 AND  "ALTURA_SOB" <= 1200) OR ("ALTURA_SOB" >=2000 AND  "ALTURA_SOB" <= 2500)

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.