I have a DEM layer from ASTER satellite and I want to get the slope information from it.

I use terrain analysis > slope, but the output is so wrong. Why is that?

Here is the DEM:

enter image description here

And here is the "Slope" that is totally wrong. It should stretch the values from 0 - 89.9097 but it does not.

enter image description here

  • Stretch is not a default style. What style settings did you put on the slope raster?
    – Jakob
    Apr 19, 2015 at 17:16
  • @Stelios M Probably because the projection was not in meters.
    – xunilk
    Apr 19, 2015 at 19:41

2 Answers 2


Aster DEMs are in EPSG 4326 (lat lon WGS84). According to the GDAL DEM documentation:

For LatLong projections near the equator, where units of latitude and units of longitude are similar, elevation (z) units can be converted to be compatible by using scale = 370400 (if elevation is in feet) or scale = 111120 (if elevation is in meters). For locations not near the equator, it would be best to reproject your grid using gdalwarp before using gdaldem.

In this answer for a problem with hillshading (Scale and Z factor have no effect on hillshade analysis in QGIS) user @Luke provides a way to calculate the correct scale ("ratio of vertical to horizontal units") by multiplying the cosine of the latitude times 111320. The scale affects slope calculations.

In the image below I was able to produce slopes in degrees from a DEM in EPSG 4326 at latitudes ranging from 19°45N and 20°N. The scale (-s) was set to 104550.67.

enter image description here

If you want to work with a DEM in a CRS that defines the measuring units of the coordinates and the elevations in meters you must reproject the DEM using raster/projections/warp (reproject). For example, reprojecting from EPSG 4326 (lat lon wgs84) to EPSG 32164 (UTM WGS84 14N). See below:

enter image description here

In this case, when calculating slope, the "ratio of vertical to horizontal units" (scale) would be set to 1.

  • I have to change the previously accepted answer and set your answer as the best fit. Thank you so much for explaining how things work with the ASTER DEM data.
    – Stelios M
    Apr 20, 2015 at 14:58

Probably because the projection was not in meters.

Slope with DEM projected in meters (UTM/31N: EPSG 25831):

enter image description here

Slope with the same DEM projected in degrees (WGS 84: EPSG 4326) and z = 1:

enter image description here

Slope with the same DEM projected in degrees (WGS 84: EPSG 4326) and z = 111320 (at the equator one horizontal unit, 1°, would correspond to about 111320 m):

enter image description here

  • Here is what I do, I open a new blank project and I set the CRS of the project to WGS84 UTM 34N. Then I load the raster layer of the DEM from the ASTER USGS. I go to the properties of that layer and I also set the CRS of the DEM to WGS 84 UTM 34N. Then I go to terrain analysis > slope and on the Z factor prompt, I keep the default which is 1. Then the result is WRONG again. If I then run it again with 111320 as Z factor then the result is CORRECT. So regardless of the projection being in meters or degrees, it needs the Z factor as 111320 or did I miss something?Thanks for solving this
    – Stelios M
    Apr 20, 2015 at 10:48
  • Aster DEMs are in lat lon WGS84 (EPSG4326). In order to calculate the slope correctly you must define the "ratio of vertical units to horizantal units" as 111120. For more information look at this answer gis.stackexchange.com/questions/95337/…. Although it is meant for hill shading, the parameters mentioned also afect slope calculations. In order to work with a CRS in meter you must reproject the original file using raster/projections/warp (reproject) not what you describe in your comment Apr 20, 2015 at 13:42

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.