2

This question already has an answer here:

I have a DEM that was made from UAV/photogrammetry techniques by Maps Made easy. In QGIS I loaded the DEM and then made a slope raster layer. My values go from 0 to a huge number like 23456e+07. Does that seem right? The highest slope on the terrain is not much more than 28%. I think the layer is spitting out wrong data. Do I need to enter a Z factor? Also, when I enter my formula in raster calculator ("slope@1" > 28) * 0 + ("slope@1" < 28) * 1 it turns my whole image black.

My end goal is to display a map with the georeferenced jpeg with areas over 28% slope shaded in red.

marked as duplicate by Andre Silva, Vince, whyzar, ArMoraer, aldo_tapia Jan 3 '18 at 10:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Your formula indicates that boolean values are treated like False = 0 and True = 1 in Raster calculator, so your conditions return either 0 or 1. By means of that your formula is wrong, because

("slope@1" > 28) * 0 is allways 0 (since n * 0 = 0)

("slope@1" < 28) * 1 is either 0 or 1.

I think your formula should be

("slope@1" < 28) * "slope@1" returning slope@1 if "slope@1" < 28 and 0 otherwise.

UPDATE

In order to restrict the maxiumum value to 28 you might use

("slope@1" < 28) * "slope@1" + ("slope@1" >= 28) * 28

... with the 2nd summand returning 28 for values above 28.

Furthermore I suggest investigation of your DEM data in points, where the slope has unexpected high values.

  • Your suggested formula worked better than mine. – MrCarbon May 10 '17 at 14:48
  • Also I find that when I create the slope layer and I use a scale factor, I get better numbers for my min/max. When I don't use conversion factor I get weird numbers like black -1743, white-3.46759e+07. Should I keep using the scale factor 111120? – MrCarbon May 10 '17 at 14:50
  • I think I wouldn't use a scale factor, but you might use the raster calculator to restric your result to max=28, see update in my answer. – Jochen Schwarze May 12 '17 at 5:21
  • Ok. The DEM is from a newly logged area with slopes. The DEM picked up some standing trees along the edges of area of interest. I wonder if that is messing up the slope raster when it's generated. I wonder if I should clip the DEM raster first, cutting out the unwanted tall trees – MrCarbon May 12 '17 at 20:20

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