I have a little doubt about the way I should calculate the value of the "scale" parameter in the r.relief command in GRASS.

In the description section of the r.relief page of the GRASS manual I read: "The scaling parameter, which compensates for a different horizontal scale than vertical scale. If scale is a number, then the ewres and nsres are multiplied by that scale to calculate the shading. (Default=1.0 for equivalent horizontal and vertical scales.)" while in the parameters section of the same page I read: "Scale factor for converting meters to elevation units". This last statement is confusing to me because it seems to contradict the previous one in my opinion.

I'm working with ASTER GDEM v2, so if I'm not wrong I should change the default value because horizontal scale is defined in degrees while vertical scale is defined in meters.

Now, what's the right value for the "scale" parameter? Is it the number of vertical scale units (meters in my case) contained in the horizontal scale unit (degree in my case)? Is it vice versa (the number of horizontal scale units contained in the vertical scale unit?) Or is it simply the default value because the vertical scale is defined in meters ("Scale factor for converting meters to elevation units")?


For the r.relief command in GRASS, the scale factor only needs to be set to a value other than 1 if your DEM does not use metres for storing the elevation. It does not matter whether the horizontal units are metres, feet or degrees. The reason for this is that r.relief uses the function G_distance internally for calculating the horizontal distance between neighbouring pixels, which always converts the result to metres, but the vertical distance is not automatically converted. If your DEM would use feet, for instance, you'd need to provide a scale factor of 1 ft / 0.3048 m = 3.281 ft/m.

Here's an example of a shaded relief of Mt. Fuji using ASTER GDEM data which uses geographical coordinates and elevation in metres. The command used was r.relief input=dem output=shaded_relief, scale=1.0.

Things are different when using gdaldem for creating the shaded relief. gdaldem always assumes that your horizontal units are metres, so if you don't tell it otherwise, it will generate a relief like this (generated using gdaldem hillshade dem.tif hillshade.png -of PNG): the dreaded "elephant skin":

To get the correct output from gdaldem, you have to tell it how to convert from horizontal units to vertical units. At the equator, one horizontal unit () would correspond to about 111320 m, at other latitudes you have to calculate the scale factor as explained in Scale and Z factor have no effect on hillshade analysis in QGIS. In the case of Mt. Fuji, which is at approximately 35 °N, the scale factor would be 91188 m/°, so you could generate the relief using gdaldem hillshade -scale 91188 dem.tif hillshade.png -of PNG:

  • 1
    Thanks a lot Jake, a really clear and full explanation. I thought that the GRASS manual refers to the scales defined in the region... so now I see that I only have to change the default scale parameter if the elevation in the dem map is not stored in metres. – Bryan Ciceri Apr 13 '15 at 18:18
  • If you have suggestions how to improve the manual page, let us know. No need to be shy, we really appreciate feedback! – markusN Apr 21 '15 at 22:24

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.