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

  • 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

  • That's exactly what I needed - thought it would be an easy one! Thanks! Nov 6 '12 at 15:26

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


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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.