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 have 3 contour shapefiles with 25m, 50m and 100m equidistance. Now I want to delete in the 25m-shp-file every **50m and **00m contour and in the 50m-shp-file every **00 contour. How can I show them using the field calculator of qgis?


share|improve this question
up vote 4 down vote accepted

If you have a contour value field, it should be possible to select **50m and **00m contours for later deletion using the following query with the modulo operator:

value % 50 = 0
share|improve this answer
I might be wrong, but I think for this to work the contour data has to be in a database (Spatialite preferred, in my case). Unless something has changed recently. N. – nhopton Jan 29 '13 at 22:11
No this will work on any layer. – Nathan W Jan 29 '13 at 23:31
Is this a new feature? – nhopton Jan 30 '13 at 8:34
I'm not sure when the modulo operator was introduced @nhopton. But I think it has been around for a few versions already. – underdark Jan 30 '13 at 11:17

The simplest method is to simply create a new field based on the modulo operator, %, of the contour value.

A more complex way would be to select the 25 layer, and then select by location all the contours of the 50 layer that overlap the selection.

share|improve this answer

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.