Bug report #11350

Raster Calculator not giving the correct raster from a slope percentage raster

Added by Prime Enrique Rendon over 9 years ago. Updated almost 9 years ago.

Category:Raster Calculator
Affected QGIS version:2.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:19641


i have a srtm_62_11 downloaded from the internet with WGS84 projection. I tried to derived slope raster from the srtm (DEM) as percentage instead of degrees and a z-factor of 113200 to convert degrees in meters (please correct me in this factor) using the Raster>>Analysis>>DEM. i have successfully made the slope raster with 0.607858 and 62.4067 as min and max values (i believe its in percentage. However when i try to use the raster calculator to derived a new raster with slope of less than or equal to 8 ("slope%@1" <= 8 using this expression), i didn't get the correct values. i only get a 0 and .999 as min and max values for the new raster.

Am i doing the right procedure or an error in the process? I'll appreciate your help.thanks


#1 Updated by Nicolas Cadieux over 9 years ago

I think you are getting 0 and 1. 0 for cells that don't meet the requirements and 1 where the cells do. You then need to multiply that by your slope layer so that the 1 get multiplied by the slope values and the 0 stay zeros...

#2 Updated by Prime Enrique Rendon over 9 years ago

how can i multiple the said values to my slope? but i'm still looking for ways to multiply it. thanks for the reply.

#3 Updated by Nyall Dawson almost 9 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

An expression like:

("slope%@1" <= 8 ) * "slope%@1"

will work

Also available in: Atom PDF