r.clump.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <h2>DESCRIPTION</h2>
  2. <em>r.clump</em> finds all areas of contiguous cell category values
  3. (connected components) in the input raster map. NULL values in the
  4. input are ignored. It assigns a unique category value to each such area
  5. (&quot;clump&quot;) in the resulting output raster map.
  6. <p>
  7. Category distinctions in the input raster map are preserved. This
  8. means that if distinct category values are adjacent, they will NOT be
  9. clumped together. The user can
  10. run <em><a href="r.reclass.html">r.reclass</a></em> prior
  11. to <em>r.clump</em> to recategorize cells and reassign cell category
  12. values.
  13. <p>
  14. <em>r.clump</em> can also perform &quot;fuzzy&quot; clumping where
  15. neighboring cells that are not identical but similar to each other are
  16. clumped together. Here, the spectral distance between two cells is
  17. scaled to the range [0, 1] and compared to the <em>threshold</em>
  18. value. Cells are clumped together if their spectral distance is &le;
  19. <em>threshold</em>. The result is very sensitive to this
  20. <em>threshold</em> value, a recommended start value is 0.01, then
  21. increasing or decreasing this value according to the desired output.
  22. Once a suitable threshold has been determined, noise can be reduced by
  23. merging small clumps with the <em>minsize</em> option.
  24. <p>
  25. <em>r.clump</em> can also use multiple raster maps of any kind (CELL,
  26. FCELL, DCELL) as input. In this case, the spectral distance between
  27. cells is used to determine the similarity of two cells. This means that
  28. input maps must be metric: the difference cell 1 - cell 2 must make
  29. sense. Categorical maps, e.g. land cover, can not be used in this case.
  30. Examples for valid inpat maps are satellite imagery, vegetation
  31. indices, elevation, climatic parameters etc.
  32. <h2>NOTES</h2>
  33. By default, the resulting clumps are connected only by their four
  34. direct neighbors (left, right, top, bottom). The <em>-d</em> flag
  35. activates also diagonal clump tracing.
  36. <p>
  37. <em>r.clump</em> works properly with raster map that contains only
  38. &quot;fat&quot; areas (more than a single cell in width). Linear
  39. elements (lines that are a single cell wide) may or may not be clumped
  40. together depending on the direction of the line - horizontal and
  41. vertical lines of cells are considered to be contiguous, but diagonal
  42. lines of cells are not considered to be contiguous and are broken up
  43. into separate clumps unless the <em>-d</em> flag is used.
  44. <p>
  45. A random color table and other support files are generated for the
  46. output raster map.
  47. <h2>EXAMPLES</h2>
  48. Perform clumping on "lakes" map (North Carolina sample dataset) and
  49. report area sizes for each lake individually rather by waterbody type:
  50. <div class="code"><pre>
  51. g.region raster=lakes -p
  52. # report sizes by waterbody type
  53. r.report lakes units=h
  54. # clump per raster polygon
  55. r.clump lakes out=lakes_individual
  56. # report sizes by individual waterbody
  57. r.report lakes_individual units=h
  58. </pre></div>
  59. <p>
  60. Perform fuzzy clumping on Landsat 7 2002 imagery (North Carolina sample dataset)
  61. <div class="code"><pre>
  62. g.region raster=lsat7_2002_10 -p
  63. r.clump in=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 \
  64. out=lsat7_2002_clump threshold=0.045
  65. # reduce noise
  66. r.clump in=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 \
  67. out=lsat7_2002_clump_min10 threshold=0.045 minsize=10
  68. </pre></div>
  69. <h2>SEE ALSO</h2>
  70. <em>
  71. <a href="r.average.html">r.average</a>,
  72. <a href="r.buffer.html">r.buffer</a>,
  73. <a href="r.distance.html">r.distance</a>,
  74. <a href="r.grow.html">r.grow</a>,
  75. <a href="r.mapcalc.html">r.mapcalc</a>,
  76. <a href="r.mfilter.html">r.mfilter</a>,
  77. <a href="r.neighbors.html">r.neighbors</a>,
  78. <a href="r.to.vect.html">r.to.vect</a>,
  79. <a href="r.reclass.html">r.reclass</a>,
  80. <a href="r.statistics.html">r.statistics</a>,
  81. <a href="r.support.html">r.support</a>
  82. </em>
  83. <h2>AUTHOR</h2>
  84. Michael Shapiro, U.S. Army Construction Engineering Research
  85. Laboratory<br>
  86. Markus Metz (diagonal clump tracing, fuzzy clumping)
  87. <p>
  88. <i>Last changed: $Date$</i>