r.relief.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <h2>DESCRIPTION</h2>
  2. <em>r.relief</em> creates a raster shaded relief map based on
  3. current resolution settings and on sun altitude, azimuth, and
  4. z-exaggeration values entered by the user. If no output shademap
  5. name is given, the new shaded relief map is named <em>&lt;input_map
  6. &gt;.shade</em>. The map is assigned a grey-scale color table.
  7. <p>The parameters controlling the shading are:
  8. <ol>
  9. <li>A raster map layer to provide elevation values for the shaded
  10. relief map. Typically, this would be a map layer of elevation;
  11. however, any raster map layer can be named.
  12. <li>The <b>altitude</b> of the sun in degrees above the horizon
  13. (a value between 0 and 90 degrees).
  14. <li>The <b>azimuth</b> of the sun in degrees to the east of north
  15. (a value between 0 and 360 degrees; clockwise from north).
  16. <li>The scaling parameter, which compensates for a different
  17. horizontal <b>scale</b> than vertical scale. If <b>scale</b> is a
  18. number, then the ewres and nsres are multiplied by that scale to
  19. calculate the shading. (Default=1.0 for equivalent horizontal and
  20. vertical scales.)
  21. <li>The <b>zscale</b> exaggeration factor that changes the apparent relief
  22. for the shaded relief map. This can be any positive (or negative) floating
  23. point value. (Default=1.0)
  24. <li>Horizontal distances are calculated in meters, using geodesic
  25. distances for a latitude-longitude projection. With an elevation map
  26. measured in feet, the <b>units</b> option can be set to automatically
  27. convert meters to international feet (0.3048 meters = 1 foot) or survey
  28. feet (1200 / 3937 meters = 1 foot). The <b>units</b> parameter overrides
  29. the <b>scale</b> parameter.
  30. </ol>
  31. <p><em>r.relief</em> assigns a grey-scale color table to the new
  32. shaded relief map.
  33. <h2>NOTES</h2>
  34. To visually improve the result of shade maps from low resolution elevation
  35. models, use <em>r.resamp.interp</em> with bilinear or bicubic method to
  36. resample the DEM at higher resolution. <em>r.relief</em> is then
  37. run on the resampled DEM.
  38. <h2>EXAMPLES</h2>
  39. <h3>Shaded relief map</h3>
  40. In this example, the aspect map in the North Carolina sample
  41. dataset location is used to hillshade the elevation map:
  42. <div class="code"><pre>
  43. g.region raster=elevation -p
  44. r.relief input=elevation output=elevation_shade
  45. </pre></div>
  46. <center>
  47. <img src="r_relief.png" alt="GRASS r.relief result (subset)" border=0>
  48. <br>
  49. <i>r.relief: shaded elevation map (subset)</i>
  50. </center>
  51. <h3>Colorizing a shaded relief map</h3>
  52. Color can be added later using <em><a href="r.shade.html">r.shade</a></em>:
  53. <div class="code"><pre>
  54. r.shade shade=elevation_shade color=elevation output=elevation_shaded
  55. </pre></div>
  56. <h3>Using the scale factor in Latitude-Longitude</h3>
  57. In Latitude-Longitude locations (or other non-metric locations), the
  58. <em>scale</em> factor has to be used:
  59. <div class="code"><pre>
  60. # Latitude-Longitude example
  61. g.region raster=srtm -p
  62. r.relief input=srtm output=srtm_shaded scale=111120
  63. </pre></div>
  64. <h3>Exporting shaded relief maps to GeoTIFF</h3>
  65. The data range of shaded relief maps usually does not permit exporting the
  66. map to GeoTIFF format along with its associated color table due to limitations
  67. in the GeoTIFF format.
  68. <p>
  69. The most simple way to export it while even reducing the file size is to
  70. export as palette byte map. This requires a conversion done in <tt>r.mapcalc</tt>,
  71. using the # operator to convert map category values to their grey scale
  72. equivalents:
  73. <div class="code"><pre>
  74. # using the map created above
  75. # create new map from map category values
  76. r.mapcalc "elevation_shade_byte = #elevation_shade"
  77. # verify data range
  78. r.info elevation_shade_byte
  79. # assign grey color table
  80. r.colors elevation_shade_byte color=grey
  81. # export (optionally: createopt="COMPRESS=DEFLATE,BIGTIFF=YES")
  82. r.out.gdal input=elevation_shade_byte createopt="COMPRESS=DEFLATE" \
  83. output=elevation_shade.tif
  84. # add overview images in GeoTIFF file for faster zooming
  85. gdaladdo --config GDAL_CACHEMAX 2000 elevation_shade.tif 2 4 8 16
  86. </pre></div>
  87. <h2>SEE ALSO</h2>
  88. <p>
  89. <!--
  90. RGB version not ported to GRASS 6 (why?):
  91. <em><a href="shade.clr.sh.html">shade.clr.sh</a></em><br>
  92. d.shade and r.shade probably cover most of the shade.clr functionality
  93. however, it is not possible to create shade+color map in one step
  94. delete this note when it is solved or if it is not considered as an issue
  95. -->
  96. <em>
  97. <a href="d.shade.html">d.shade</a>,
  98. <a href="d.his.html">d.his</a>,
  99. <a href="g.region.html">g.region</a>,
  100. <a href="r.shade.html">r.shade</a>,
  101. <a href="r.blend.html">r.blend</a>,
  102. <a href="r.colors.html">r.colors</a>,
  103. <a href="r.mapcalc.html">r.mapcalc</a>,
  104. <a href="r.resamp.interp.html">r.resamp.interp</a>
  105. </em>
  106. <h2>AUTHORS</h2>
  107. Jim Westervelt, U.S. Army Construction Engineering Research Laboratory
  108. <br>
  109. Markus Metz: Enhanced fast C version of r.relief for GRASS GIS 7
  110. <p><i>Last changed: $Date$</i>