r.slope.aspect.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <h2>DESCRIPTION</h2>
  2. <em>r.slope.aspect</em> generates raster maps of slope, aspect, curvatures and
  3. first and second order partial derivatives from a raster map of true
  4. elevation values. The user must specify the input <b>elevation</b> raster map
  5. and at least one output raster maps. The user can also specify the
  6. <b>format</b> for slope (degrees, percent; default=degrees), and the
  7. <b>zscale</b>: multiplicative factor to convert elevation units to horizontal units;
  8. (default 1.0).
  9. <p>
  10. The <b>elevation</b> input raster map specified by the user must contain true
  11. elevation values, <em>not</em> rescaled or categorized data. If the elevation
  12. values are in other units than in the horizontal units,
  13. they must be converted to horizontal units using the parameter <b>zscale</b>.
  14. <em>In GRASS GIS 7, vertical units are not assumed to be meters any more.
  15. For example, if both your vertical and horizontal units are feet,
  16. parameter <b>zscale</b> must not be used</em>.
  17. <p>
  18. The <b>aspect</b> output raster map indicates the direction that slopes
  19. are facing counterclockwise from East: 90 degrees is North, 180 is
  20. West, 270 is South, 360 is East. Zero aspect indicates flat areas with
  21. zero slope. Category and color table files are also generated for the
  22. aspect raster map. <br> Note: These values can be transformed to
  23. azimuth values (90 is East, 180 is South, 270 is West, 360 is North)
  24. using <a href="r.mapcalc.html">r.mapcalc</a>:
  25. <div class="code"><pre>
  26. # convert angles from CCW from East to CW from North
  27. # modulus (%) can not be used with floating point aspect values
  28. r.mapcalc "azimuth_aspect = if(ccw_aspect == 0, 0, \
  29. if(ccw_aspect < 90, 90 - ccw_aspect, \
  30. 450 - ccw_aspect)))"
  31. </pre></div>
  32. Alternatively, the <b>-n</b> flag can be used to produce aspect as
  33. degrees CW from North. Aspect for flat areas is then set to -9999
  34. (default: 0).
  35. <p>
  36. The aspect for slope equal to zero (flat areas) is set to zero (-9999
  37. with <b>-n</b> flag). Thus, most cells with a very small slope end up
  38. having category 0, 45, ..., 360 in <b>aspect</b> output. It is possible
  39. to reduce the bias in these directions by filtering out the aspect in
  40. areas where the terrain is almost flat. A option <b>min_slope</b> can
  41. be used to specify the minimum slope for which aspect is computed. For
  42. all cells with slope&nbsp;&lt;&nbsp;<b>min_slope</b>, both slope and
  43. aspect are set to zero.
  44. <center>
  45. <img src="aspect_diagram.png" border="0">
  46. </center>
  47. <p>
  48. The <b>slope</b> output raster map contains slope values, stated in degrees of
  49. inclination from the horizontal if <b>format</b>=degrees option (the default)
  50. is chosen, and in percent rise if <b>format</b>=percent option is chosen.
  51. Category and color table files are generated.
  52. <p>
  53. Profile and tangential curvatures are the curvatures in the direction of
  54. steepest slope and in the direction of the contour tangent respectively. The
  55. curvatures are expressed as 1/metres, e.g. a curvature of 0.05 corresponds to a
  56. radius of curvature of 20m. Convex form values are positive and concave form values
  57. are negative.
  58. <p><table width="100%" border="0">
  59. <tr valign="baseline">
  60. <td>
  61. <center>
  62. <img src="dem.png" border="1">
  63. <p> Example DEM
  64. <br><br>
  65. </center>
  66. </td>
  67. <td>
  68. </td>
  69. </tr>
  70. <tr valign="baseline">
  71. <td>
  72. <center>
  73. <img src="slope.png" border="1">
  74. <p> Slope (degree) from example DEM
  75. <br><br>
  76. </center>
  77. </td>
  78. <td>
  79. <center>
  80. <img src="aspect.png" border="1">
  81. <p> Aspect (degree) from example DEM
  82. <br><br>
  83. </center>
  84. </td>
  85. </tr>
  86. <tr valign="baseline">
  87. <td>
  88. <center>
  89. <img src="tcurv.png" border="1">
  90. <p> Tangential curvature (m<sup>-1</sup>) from example DEM
  91. <br><br>
  92. </center>
  93. </td>
  94. <td>
  95. <center>
  96. <img src="pcurv.png" border="1">
  97. <p> Profile curvature (m<sup>-1</sup>) from example DEM
  98. <br><br>
  99. </center>
  100. </td>
  101. <td>
  102. </td>
  103. </tr>
  104. </table>
  105. <p>For some applications, the user will wish to use a reclassified raster map
  106. of slope that groups slope values into ranges of slope. This can be done using
  107. <em><a href="r.reclass.html">r.reclass</a></em>. An example of a useful
  108. reclassification is given below:
  109. <div class="code"><pre> category range category labels
  110. (in degrees) (in percent)
  111. 1 0- 1 0- 2%
  112. 2 2- 3 3- 5%
  113. 3 4- 5 6- 10%
  114. 4 6- 8 11- 15%
  115. 5 9- 11 16- 20%
  116. 6 12- 14 21- 25%
  117. 7 15- 90 26% and higher
  118. The following color table works well with the above
  119. reclassification.
  120. category red green blue
  121. 0 179 179 179
  122. 1 0 102 0
  123. 2 0 153 0
  124. 3 128 153 0
  125. 4 204 179 0
  126. 5 128 51 51
  127. 6 255 0 0
  128. 7 0 0 0</pre></div>
  129. <h2>NOTES</h2>
  130. To ensure that the raster elevation map is not inappropriately resampled,
  131. the settings for the current region are modified slightly (for the execution
  132. of the program only): the resolution is set to match the resolution of
  133. the elevation raster map and the edges of the region (i.e. the north, south, east
  134. and west) are shifted, if necessary, to line up along edges of the nearest
  135. cells in the elevation map. If the user really wants the raster elevation map
  136. resampled to the current region resolution, the <b>-a</b> flag should be specified.
  137. <p>
  138. The current mask is ignored.
  139. <p>
  140. The algorithm used to determine slope and aspect uses a 3x3
  141. neighborhood around each cell in the raster elevation map. Thus,
  142. slope and aspect are not determineed for cells adjacent to
  143. the edges and NULL cells in the elevation map layer. These cells are
  144. by default set to nodata in output raster maps. With the <b>-e</b> flag,
  145. output values are estimated for these cells, avoiding cropping along
  146. the edges.
  147. <p>
  148. Horn's formula is used to find the first order derivatives in x and y directions.
  149. <p>
  150. Only when using integer elevation models, the aspect is biased in 0,
  151. 45, 90, 180, 225, 270, 315, and 360 directions; i.e., the distribution
  152. of aspect categories is very uneven, with peaks at 0, 45,..., 360 categories.
  153. When working with floating point elevation models, no such aspect bias occurs.
  154. <h2>EXAMPLES</h2>
  155. <h3>Calculation of slope, aspect, profile and tangential curvature</h3>
  156. In this example a slope, aspect, profile and tangential curvature map
  157. are computed from an elevation raster map (North Carolina sample
  158. dataset):
  159. <div class="code"><pre>
  160. g.region raster=elevation
  161. r.slope.aspect elevation=elevation slope=slope aspect=aspect pcurvature=pcurv tcurvature=tcurv
  162. # set nice color tables for output raster maps
  163. r.colors -n map=slope color=sepia
  164. r.colors map=aspect color=aspectcolr
  165. r.colors map=pcurv color=curvature
  166. r.colors map=tcurv color=curvature
  167. </pre></div>
  168. <center>
  169. <img src="r_slope_aspect_slope.png" border="0">
  170. <img src="r_slope_aspect_aspect.png" border="0">
  171. <img src="r_slope_aspect_pcurv.png" border="0">
  172. <img src="r_slope_aspect_tcurv.png" border="0">
  173. <p>
  174. Figure: Slope, aspect, profile and tangential curvature raster map (North Carolina dataset)
  175. </center>
  176. <h3>Classification of major aspect directions in compass orientation</h3>
  177. In the following example (based on the North Carolina sample dataset)
  178. we first generate the standard aspect map (oriented CCW from East), then
  179. convert it to compass orientation, and finally classify four major aspect
  180. directions (N, E, S, W):
  181. <div class="code"><pre>
  182. g.region raster=elevation -p
  183. # generate integer aspect map with degrees CCW from East
  184. r.slope.aspect elevation=elevation aspect=myaspect precision=CELL
  185. # generate compass orientation and classify four major directions (N, E, S, W)
  186. r.mapcalc "aspect_4_directions = eval( \\
  187. compass=(450 - myaspect ) % 360, \\
  188. if(compass >=0. && compass < 45., 1) \\
  189. + if(compass >=45. && compass < 135., 2) \\
  190. + if(compass >=135. && compass < 225., 3) \\
  191. + if(compass >=225. && compass < 315., 4) \\
  192. + if(compass >=315., 1) \\
  193. )"
  194. # assign text labels
  195. r.category aspect_4_directions separator=comma rules=- << EOF
  196. 1,north
  197. 2,east
  198. 3,south
  199. 4,west
  200. EOF
  201. # assign color table
  202. r.colors aspect_4_directions rules=- << EOF
  203. 1 253,184,99
  204. 2 178,171,210
  205. 3 230,97,1
  206. 4 94,60,153
  207. EOF
  208. </pre></div>
  209. <center>
  210. <img src="r_slope_aspect_4_directions.png" alt="Aspect map classified to four major compass directions"><br>
  211. Aspect map classified to four major compass directions (zoomed subset shown)
  212. </center>
  213. <h2>REFERENCES</h2>
  214. <ul>
  215. <li> Horn, B. K. P. (1981). <i>Hill Shading and the Reflectance Map</i>, Proceedings
  216. of the IEEE, 69(1):14-47.
  217. <li> Mitasova, H. (1985). <i>Cartographic aspects of computer surface modeling. PhD thesis.</i>
  218. Slovak Technical University , Bratislava
  219. <li> Hofierka, J., Mitasova, H., Neteler, M., 2009. <i>Geomorphometry in GRASS GIS.</i>
  220. In: Hengl, T. and Reuter, H.I. (Eds), <i>Geomorphometry: Concepts, Software, Applications. </i>
  221. Developments in Soil Science, vol. 33, Elsevier, 387-410 pp,
  222. <a href="http://www.geomorphometry.org">http://www.geomorphometry.org</a>
  223. </ul>
  224. <h2>SEE ALSO</h2>
  225. <em>
  226. <a href="r.mapcalc.html">r.mapcalc</a>,
  227. <a href="r.neighbors.html">r.neighbors</a>,
  228. <a href="r.reclass.html">r.reclass</a>,
  229. <a href="r.rescale.html">r.rescale</a>
  230. </em>
  231. <h2>AUTHORS</h2>
  232. Michael Shapiro, U.S.Army Construction Engineering Research Laboratory<br>
  233. Olga Waupotitsch, U.S.Army Construction Engineering Research Laboratory
  234. <p>
  235. <i>Last changed: $Date$</i>