r.profile.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <h2>DESCRIPTION</h2>
  2. This program outputs two or four column (with <b>-g</b>) data to stdout or
  3. an ASCII file. The default two column output consists of cumulative profile
  4. length (in meters) and raster value. The optional four column output consists
  5. of easting, northing, cumlative profile length (m), and raster value. Profile
  6. end or "turning" points can be set manually with the <b>profile</b>
  7. argument or selected interactively from the GRASS monitor by setting the
  8. <b>-i</b> flag. The profile resolution, or distance between profile
  9. points, is obtained from the current region resolution, or can be manually
  10. set with the <b>res</b> argument.
  11. <p>The <b>-i</b> flag allows the user for selecting the profile from the GRASS
  12. monitor by clicking the left mouse button along the profile; clicking the
  13. right mouse button ends the profile.
  14. <p>The <b>profile</b> parameter can be set to comma separated geographic
  15. coordinates for profile line endpoints. The interactive flag (<b>-i</b>)
  16. overrides this option. Alternatively the coordinate pairs can be piped
  17. from stdin, one comma separated pair per line.
  18. <p>The <b>res</b> parameter sets the distance between each profile point
  19. (resolution). The resolution must be provided in GRASS database units (i.e.
  20. decimal degrees for Lat Long databases and meters for UTM). By default
  21. <em>r.profile</em> uses the resolution of the current GRASS region.
  22. <p>The <b>null</b> parameter can optionally be set to change the character
  23. string representing null values.
  24. <h2>OUTPUT FORMAT</h2>
  25. The multi column output from <em>r.profile</em> is intended for easy use in
  26. other programs. The output can be piped (|) directly into other programs or
  27. saved to a file for later use. Output with geographic coordinates (<em>-g</em>)
  28. is compatible with <em><a href="v.in.ascii.html">v.in.ascii</a></em> and can
  29. be piped direcly into this program.
  30. <div class="code"><pre>
  31. r.profile -ig input=elev.rast | v.in.ascii output=elev.profile separator=space
  32. </pre></div>
  33. The 2 column output is compatible with most plotting programs.
  34. <p>The optional RGB output provides the associated GRASS colour value for
  35. each profile point.
  36. <h2>EXAMPLES</h2>
  37. <b>Example 1</b><br>
  38. Extract a profile with coordinates provided on the command line:
  39. <div class="code"><pre>
  40. r.profile input=elev.rast output=profile.pts profile=562517,7779433,562984,7779533,563875,7779800
  41. </pre></div>
  42. This will extract a profile along the track defined by the three coordinate
  43. pairs.
  44. <p><br>
  45. <b>Example 2</b><br>
  46. Extract a profile by interactively selecting the profile route from the GRASS
  47. monitor:
  48. <div class="code"><pre>
  49. r.profile -i input=elev.rast output=profile.pts
  50. </pre></div>
  51. Use the left mouse button to select the profile route in the GRASS monitor. Use the
  52. right mouse button to end the profile.
  53. <p><br>
  54. <b>Example 3</b><br>
  55. Extract a profile with coordinates provided from standard input or an external file:
  56. <p>First create a points file with <em><a href="d.where.html">d.where</a></em>
  57. <div class="code"><pre>
  58. d.where > saved.points
  59. </pre></div>
  60. Then pipe the points file into r.profile
  61. <div class="code"><pre>
  62. cat saved.points | r.profile input=elev.rast output=profile.pts
  63. </pre></div>
  64. The advantage of this method is that the same profile points can be piped into
  65. different GRASS rasters by changing the input parameter.
  66. <p>With this method the coordinates must be given as space or tab separated easting
  67. and northing. Labels after these values are ignored.
  68. <p>Another example using d.where:
  69. <div class="code"><pre>
  70. d.where | r.profile elevation.dem
  71. </pre></div>
  72. <p><br>
  73. <b>Example 4</b><br>
  74. Pipe coordinates into r.profile
  75. <div class="code"><pre>
  76. r.profile elevation.dem res=1000 &lt;&lt; EOF
  77. 591243,4926344
  78. 592509,4922156
  79. 594100,4920793
  80. 599910,4919365
  81. 602929,4919235
  82. 604844,4918391
  83. 606468,4917190
  84. 607766,4915664
  85. EOF
  86. </pre></div>
  87. <h2>NOTES</h2>
  88. The profile resolution is measured exactly from the supplied end or
  89. "turning" point along the profile. The end of a profile segment will be an
  90. exact multiple of the profile resolution and will therefore not always match
  91. the end point coordinates entered for the segmanet.
  92. <p>To extract the numbers in scripts, following parameters can be used:
  93. <div class="code"><pre>
  94. r.profile input=dgm12.5 profile=3570631,5763556 2>/dev/null
  95. </pre></div>
  96. This filters out the everything except the numbers.
  97. <h2>SEE ALSO</h2>
  98. <em>
  99. <a href="v.in.ascii.html">v.in.ascii</a>,
  100. <a href="d.where.html">d.where</a>,
  101. <a href="d.profile.html">d.profile</a>,
  102. <a href="r.what.html">r.what</a>,
  103. <a href="r.transect.html">r.transect</a>,
  104. <a href="wxGUI.html">wxGUI profile tool</a>
  105. </em>
  106. <h2>AUTHOR</h2>
  107. <a href="mailto:bcovill@tekmap.ns.ca">Bob Covill</a>
  108. <p><i>Last changed: $Date$</i>