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

How can I extract values > 0 from an overall raster?

I have a water level grid and a DTM from which I've derived flood depths (using the raster calculator) but obviously the final result contains negative values where there is no flooding.

I want to remove these values (or set them to null) just leaving the positive flood depths.

Many thanks

share|improve this question
How about creating an unsigned 8+ bit raster? – Aaron Nov 6 '12 at 15:29

You can use the Raster Calculator for this, see "Using a Mask" here

share|improve this answer
That's exactly what I needed - thought it would be an easy one! Thanks! – Ed Rollason Nov 6 '12 at 15:26

Haven't tested it, but the "Sieve" function in the QGIS raster menu (gdal tools) should output a raster containing only values up to a specific value.

share|improve this answer

Based on the raster calculator you can use the following formula:


This way you will get all values less than 0 as No Data

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.