Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm working with qgis, v. 2.0.1. I have several soil types. They are (amongst others) described with slope indications. I already calculated the slope from the dtm in degrees, but as de description of the soil types is in percentage, I need to calculate the slope in percentage. I tried two things: first I tried the analysis tool from the raster section, but it didn't work. The result was just black with values from 0 to 0. The same happened when I tried to calculate the percentage in the raster calculator but the result was the same. Maybe I need to say that the terrain is pretty plain. What else can I do? Thanks.

UPDATE: I tried the raster calculator and did what radouxju suggested. It gave me a black picture with values from 1756.64 to 1756.64. But as soon as I click in the picture the values are "normal", say 5.88 or 13.224 or something like that. The same happens when I try the gdaldem tool but with values from 0 to 0. I also tried to change the contrast enhancement (like strech to min/max) but it didn't change anything.

Update 2: I just found out that maybe i have to set the scale to 111120.(http://learninggis.com/working-with-dem-models-qgis-quantum-gis) but that doesn't work neither (result: black, values 0-0).

share|improve this question
for a quick change, slope[percent] = tan(slope[degree])*100, or you can change your soil description slope[degree] = atan(slope[percent]/100) –  radouxju Jun 6 at 10:49

3 Answers 3

Use the gdaldem tool http://www.gdal.org/gdaldem.html as

gdaldem slope input.dem output_in_percents.tif -p -of GTiff

From the manual page: "-p : if specified, the slope will be expressed as percent slope. Otherwise, it is expressed as degrees "

QGIS generates a similar gdaldem command and degrees/percents is selected here:

enter image description here

share|improve this answer

Some other things to notice:

  1. If you converted the degree slope to percent by using the tan, check to see that your input and output have floating point values. Your results with values from 0 to 0 seem to me as a integer conversion problem
  2. If you are calculating your slope again (using r.slope.aspect or gdaldem), check to see if your horizontal units are the same as your vertical units, that is, check your projection
  3. I've seen two ways GIS softwares calculate slope, one based on the maximum change in elevation for each cell in relation to it's neighbor (ArcMAP) and the other based on the harmonic mean of the slopes on the X and Y direction (ERDAS Imagine). Not sure how gdaldem or grass handles. So be aware that your results may vary depending on the tool used.
share|improve this answer
GDAL is re-using algorithms from GRASS which according to this document is selecting the steepest slope grass.osgeo.org/grass64/manuals/r.slope.aspect.html –  user30184 Jun 6 at 11:53

There are a couple of ways to get a slope raster with units in percent. In addition to the 1st answer below by user30184, you can also choose the GRASS module r.slope.aspect which calculates several geo-morphological layers, including slope, and you can choose to output either in degrees or percent. It's under in Processing menu, under GRASS -> raster. But I think you need to first check your "pretty plain" DTM. What is the resolution? Check some cell values and be sure you have a slope at all.

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.