r.grow.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <h2>DESCRIPTION</h2>
  2. <em>r.grow</em> adds cells around the perimeters of all areas
  3. in a user-specified raster map layer and stores the output in
  4. a new raster map layer. The user can use it to grow by one or
  5. more than one cell (by varying the size of the <b>radius</b>
  6. parameter), or like <em>r.buffer</em>, but with the
  7. option of preserving the original cells (similar to combining
  8. <em>r.buffer</em> and <em>r.patch</em>).
  9. <p>
  10. If <b>radius</b> is negative,<em>r.grow</em> shrinks areas by removing
  11. cells around the perimeters of all areas.
  12. <h2>NOTES</h2>
  13. The user has the option of specifying three different metrics which
  14. control the geometry in which grown cells are created, (controlled by
  15. the <b>metric</b> parameter): <i>Euclidean</i>, <i>Manhattan</i>, and
  16. <i>Maximum</i>.
  17. <p>The <i>Euclidean distance</i> or <i>Euclidean metric</i> is the "ordinary" distance
  18. between two points that one would measure with a ruler, which can be
  19. proven by repeated application of the Pythagorean theorem.
  20. The formula is given by:
  21. <div class="code"><pre>d(dx,dy) = sqrt(dx^2 + dy^2)</pre></div>
  22. Cells grown using this metric would form isolines of distance that are
  23. circular from a given point, with the distance given by the <b>radius</b>.
  24. <p>The <i>Manhattan metric</i>, or <i>Taxicab geometry</i>, is a form of geometry in
  25. which the usual metric of Euclidean geometry is replaced by a new
  26. metric in which the distance between two points is the sum of the (absolute)
  27. differences of their coordinates. The name alludes to the grid layout of
  28. most streets on the island of Manhattan, which causes the shortest path a
  29. car could take between two points in the city to have length equal to the
  30. points' distance in taxicab geometry.
  31. The formula is given by:
  32. <div class="code"><pre>d(dx,dy) = abs(dx) + abs(dy)</pre></div>
  33. where cells grown using this metric would form isolines of distance that are
  34. rhombus-shaped from a given point.
  35. <p>The <i>Maximum metric</i> is given by the formula
  36. <div class="code"><pre>d(dx,dy) = max(abs(dx),abs(dy))</pre></div>
  37. where the isolines of distance from a point are squares.
  38. <p>If there are two cells which are equal candidates to grow into an empty space,
  39. <em>r.grow</em> will choose the northernmost candidate; if there are multiple
  40. candidates with the same northing, the westernmost is chosen.
  41. <h2>EXAMPLE</h2>
  42. In this example, the lakes map in the
  43. North Carolina sample dataset location is buffered:
  44. <div class="code"><pre>
  45. g.region raster=lakes -p
  46. # the lake raster map pixel resolution is 10m
  47. r.grow input=lakes output=lakes_grown_100m radius=10
  48. </pre></div>
  49. Shrinking instead of growing:
  50. <div class="code"><pre>
  51. g.region raster=lakes -p
  52. # the lake raster map pixel resolution is 10m
  53. r.grow input=lakes output=lakes_shrunk_100m radius=-10
  54. </pre></div>
  55. <h2>SEE ALSO</h2>
  56. <em>
  57. <a href="r.buffer.html">r.buffer</a>,
  58. <a href="r.grow.distance.html">r.grow.distance</a>,
  59. <a href="r.patch.html">r.patch</a>
  60. </em>
  61. <p><em><a href="http://en.wikipedia.org/wiki/Euclidean_metric">Wikipedia Entry: Euclidean Metric</a></em><br>
  62. <em><a href="http://en.wikipedia.org/wiki/Manhattan_metric">Wikipedia Entry: Manhattan Metric</a></em>
  63. <h2>AUTHORS</h2>
  64. Marjorie Larson,
  65. U.S. Army Construction Engineering Research Laboratory
  66. <p>Glynn Clements
  67. <!--
  68. <p>
  69. <i>Last changed: $Date$</i>
  70. -->