1r.clump(1)                    Grass User's Manual                   r.clump(1)
2
3
4

NAME

6       r.clump   -  Recategorizes  data in a raster map by grouping cells that
7       form physically discrete areas into unique categories.
8

KEYWORDS

10       raster, statistics, reclass, clumps
11

SYNOPSIS

13       r.clump
14       r.clump --help
15       r.clump  [-dg]  input=name[,name,...]   [output=name]    [title=string]
16       [threshold=float]      [minsize=integer]      [--overwrite]    [--help]
17       [--verbose]  [--quiet]  [--ui]
18
19   Flags:
20       -d
21           Clump also diagonal cells
22           Clumps are also traced along diagonal neighboring cells
23
24       -g
25           Print only the number of clumps in shell script style
26
27       --overwrite
28           Allow output files to overwrite existing files
29
30       --help
31           Print usage summary
32
33       --verbose
34           Verbose module output
35
36       --quiet
37           Quiet module output
38
39       --ui
40           Force launching GUI dialog
41
42   Parameters:
43       input=name[,name,...] [required]
44           Name of input raster map(s)
45
46       output=name
47           Name for output raster map
48
49       title=string
50           Title for output raster map
51
52       threshold=float
53           Threshold to identify similar cells
54           Valid range: 0 = identical to < 1 = maximal difference
55           Default: 0
56
57       minsize=integer
58           Minimum clump size in cells
59           Clumps smaller than minsize will be merged to form larger clumps
60           Default: 1
61

DESCRIPTION

63       r.clump finds all areas of contiguous cell category  values  (connected
64       components)  in  the  input  raster  map.  NULL values in the input are
65       ignored. It assigns a unique category value to each such area ("clump")
66       in the resulting output raster map.
67
68       Category  distinctions  in  the  input  raster map are preserved.  This
69       means that if distinct category values are adjacent, they will  NOT  be
70       clumped together. The user can run r.reclass prior to r.clump to recat‐
71       egorize cells and reassign cell category values.
72
73       r.clump can also perform "fuzzy" clumping where neighboring cells  that
74       are not identical but similar to each other are clumped together. Here,
75       the spectral distance between two cells is scaled to the range  [0,  1]
76       and  compared  to  the  threshold  value. Cells are clumped together if
77       their spectral distance is ≤ threshold. The result is very  sensitive
78       to  this  threshold  value,  a  recommended  start  value is 0.01, then
79       increasing or decreasing this value according to  the  desired  output.
80       Once  a suitable threshold has been determined, noise can be reduced by
81       merging small clumps with the minsize option.
82
83       r.clump can also use multiple raster maps of  any  kind  (CELL,  FCELL,
84       DCELL)  as  input. In this case, the spectral distance between cells is
85       used to determine the similarity of two cells. This  means  that  input
86       maps  must  be  metric: the difference cell 1 - cell 2 must make sense.
87       Categorical maps, e.g. land cover, can not be used in this case.  Exam‐
88       ples  for  valid  inpat maps are satellite imagery, vegetation indices,
89       elevation, climatic parameters etc.
90

NOTES

92       By default, the resulting clumps  are  connected  only  by  their  four
93       direct neighbors (left, right, top, bottom). The -d flag activates also
94       diagonal clump tracing.
95
96       r.clump works properly with raster map that contains only  "fat"  areas
97       (more  than  a single cell in width). Linear elements (lines that are a
98       single cell wide) may or may not be clumped together depending  on  the
99       direction of the line - horizontal and vertical lines of cells are con‐
100       sidered to be contiguous, but diagonal lines of cells are  not  consid‐
101       ered to be contiguous and are broken up into separate clumps unless the
102       -d flag is used.
103
104       A random color table and other support files are generated for the out‐
105       put raster map.
106

EXAMPLES

108       Perform  clumping  on  "lakes"  map (North Carolina sample dataset) and
109       report area sizes for each lake individually rather by waterbody type:
110       g.region raster=lakes -p
111       # report sizes by waterbody type
112       r.report lakes units=h
113       # clump per raster polygon
114       r.clump lakes out=lakes_individual
115       # report sizes by individual waterbody
116       r.report lakes_individual units=h
117
118       Perform fuzzy clumping on Landsat 7 2002 imagery (North Carolina sample
119       dataset)
120       g.region raster=lsat7_2002_10 -p
121       r.clump in=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 \
122               out=lsat7_2002_clump threshold=0.045
123       # reduce noise
124       r.clump in=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 \
125               out=lsat7_2002_clump_min10 threshold=0.045 minsize=10
126

SEE ALSO

128          r.average,   r.buffer,  r.distance,  r.grow,  r.mapcalc,  r.mfilter,
129       r.neighbors, r.to.vect, r.reclass, r.statistics, r.support
130

AUTHOR

132       Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
133       Markus Metz (diagonal clump tracing, fuzzy clumping)
134

SOURCE CODE

136       Available at: r.clump source code (history)
137
138       Main index | Raster index | Topics index | Keywords index  |  Graphical
139       index | Full index
140
141       © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
142
143
144
145GRASS 7.8.2                                                         r.clump(1)
Impressum