r.grow.distance.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <h2>DESCRIPTION</h2>
  2. <em>r.grow.distance</em> generates raster maps representing the
  3. distance to the nearest non-null cell in the input map and/or the
  4. value of the nearest non-null cell.
  5. <h2>NOTES</h2>
  6. The flag <b>-n</b> calculates the respective pixel distances to the
  7. nearest NULL cell.
  8. <p>
  9. The user has the option of specifying five different metrics which
  10. control the geometry in which grown cells are created, (controlled by
  11. the <b>metric</b> parameter): <i>Euclidean</i>, <i>Squared</i>,
  12. <i>Manhattan</i>, <i>Maximum</i>, and <i>Geodesic</i>.
  13. <p>
  14. The <i>Euclidean distance</i> or <i>Euclidean metric</i> is the "ordinary" distance
  15. between two points that one would measure with a ruler, which can be
  16. proven by repeated application of the Pythagorean theorem.
  17. The formula is given by:
  18. <div class="code"><pre>
  19. d(dx,dy) = sqrt(dx^2 + dy^2)
  20. </pre></div>
  21. Cells grown using this metric would form isolines of distance that are
  22. circular from a given point, with the distance given by the <b>radius</b>.
  23. <p>
  24. The <i>Squared</i> metric is the <i>Euclidean</i> distance squared,
  25. i.e. it simply omits the square-root calculation. This may be faster,
  26. and is sufficient if only relative values are required.
  27. <p>
  28. The <i>Manhattan metric</i>, or <i>Taxicab geometry</i>, is a form of geometry in
  29. which the usual metric of Euclidean geometry is replaced by a new
  30. metric in which the distance between two points is the sum of the (absolute)
  31. differences of their coordinates. The name alludes to the grid layout of
  32. most streets on the island of Manhattan, which causes the shortest path a
  33. car could take between two points in the city to have length equal to the
  34. points' distance in taxicab geometry.
  35. The formula is given by:
  36. <div class="code"><pre>
  37. d(dx,dy) = abs(dx) + abs(dy)
  38. </pre></div>
  39. where cells grown using this metric would form isolines of distance that are
  40. rhombus-shaped from a given point.
  41. <p>
  42. The <i>Maximum metric</i> is given by the formula
  43. <div class="code"><pre>
  44. d(dx,dy) = max(abs(dx),abs(dy))
  45. </pre></div>
  46. where the isolines of distance from a point are squares.
  47. <p>
  48. The <i>Geodesic metric</i> is calculated as geodesic distance, to
  49. be used only in latitude-longitude locations. It is recommended
  50. to use it along with the <em>-m</em> flag in order to output
  51. distances in meters instead of map units.
  52. <h2>EXAMPLES</h2>
  53. <h3>Distance from the streams network</h3>
  54. North Carolina sample dataset:
  55. <div class="code"><pre>
  56. g.region raster=streams_derived -p
  57. r.grow.distance input=streams_derived distance=dist_from_streams
  58. </pre></div>
  59. <div align="center" style="margin: 10px">
  60. <img src="r_grow_distance.png" border=0><br>
  61. <i>Euclidean distance from the streams network in meters (map subset)</i>
  62. </div>
  63. <div align="center" style="margin: 10px">
  64. <img src="r_grow_distance_zoom.png" border=0><br>
  65. <i>Euclidean distance from the streams network in meters (detail, numbers shown
  66. with d.rast.num)</i>
  67. </div>
  68. <h3>Distance from sea in meters in latitude-longitude location</h3>
  69. <div class="code"><pre>
  70. g.region raster=sea -p
  71. r.grow.distance -m input=sea distance=dist_from_sea_geodetic metric=geodesic
  72. </pre></div>
  73. <p>
  74. <center>
  75. <img src="r_grow_distance_sea.png" border=1><br>
  76. <i>Geodesic distances to sea in meters</i>
  77. </center>
  78. <h2>SEE ALSO</h2>
  79. <em>
  80. <a href="r.grow.html">r.grow</a>,
  81. <a href="r.distance.html">r.distance</a>,
  82. <a href="r.buffer.html">r.buffer</a>,
  83. <a href="r.cost.html">r.cost</a>,
  84. <a href="r.patch.html">r.patch</a>
  85. </em>
  86. <p>
  87. <em>
  88. <a href="http://en.wikipedia.org/wiki/Euclidean_metric">Wikipedia Entry:
  89. Euclidean Metric</a><br>
  90. <a href="http://en.wikipedia.org/wiki/Manhattan_metric">Wikipedia Entry:
  91. Manhattan Metric</a>
  92. </em>
  93. <h2>AUTHORS</h2>
  94. Glynn Clements
  95. <p>
  96. <i>Last changed: $Date$</i>