1r.grow.distance(1) GRASS GIS User's Manual r.grow.distance(1)
2
3
4
6 r.grow.distance - Generates a raster map containing distances to near‐
7 est raster features and/or the value of the nearest non-null cell.
8
10 raster, distance, proximity
11
13 r.grow.distance
14 r.grow.distance --help
15 r.grow.distance [-mn] input=name [distance=name] [value=name]
16 [metric=string] [minimum_distance=float] [maximum_distance=float]
17 [--overwrite] [--help] [--verbose] [--quiet] [--ui]
18
19 Flags:
20 -m
21 Output distances in meters instead of map units
22
23 -n
24 Calculate distance to nearest NULL cell
25
26 --overwrite
27 Allow output files to overwrite existing files
28
29 --help
30 Print usage summary
31
32 --verbose
33 Verbose module output
34
35 --quiet
36 Quiet module output
37
38 --ui
39 Force launching GUI dialog
40
41 Parameters:
42 input=name [required]
43 Name of input raster map
44
45 distance=name
46 Name for distance output raster map
47
48 value=name
49 Name for value output raster map
50
51 metric=string
52 Metric
53 Options: euclidean, squared, maximum, manhattan, geodesic
54 Default: euclidean
55
56 minimum_distance=float
57 Minimum distance threshold
58
59 maximum_distance=float
60 Maximum distance threshold
61
63 r.grow.distance generates raster maps representing the distance to the
64 nearest non-null cell in the input map and/or the value of the nearest
65 non-null cell.
66
68 The flag -n calculates the respective pixel distances to the nearest
69 NULL cell.
70
71 The user has the option of specifying five different metrics which con‐
72 trol the geometry in which grown cells are created, (controlled by the
73 metric parameter): Euclidean, Squared, Manhattan, Maximum, and Geo‐
74 desic.
75
76 The Euclidean distance or Euclidean metric is the "ordinary" distance
77 between two points that one would measure with a ruler, which can be
78 proven by repeated application of the Pythagorean theorem. The formula
79 is given by:
80 d(dx,dy) = sqrt(dx^2 + dy^2)
81 Cells grown using this metric would form isolines of distance that are
82 circular from a given point, with the distance given by the radius.
83
84 The Squared metric is the Euclidean distance squared, i.e. it simply
85 omits the square-root calculation. This may be faster, and is suffi‐
86 cient if only relative values are required.
87
88 The Manhattan metric, or Taxicab geometry, is a form of geometry in
89 which the usual metric of Euclidean geometry is replaced by a new met‐
90 ric in which the distance between two points is the sum of the (abso‐
91 lute) differences of their coordinates. The name alludes to the grid
92 layout of most streets on the island of Manhattan, which causes the
93 shortest path a car could take between two points in the city to have
94 length equal to the points’ distance in taxicab geometry. The formula
95 is given by:
96 d(dx,dy) = abs(dx) + abs(dy)
97 where cells grown using this metric would form isolines of distance
98 that are rhombus-shaped from a given point.
99
100 The Maximum metric is given by the formula
101 d(dx,dy) = max(abs(dx),abs(dy))
102 where the isolines of distance from a point are squares.
103
104 The Geodesic metric is calculated as geodesic distance, to be used only
105 in latitude-longitude locations. It is recommended to use it along with
106 the -m flag in order to output distances in meters instead of map
107 units.
108
109 If minimum_distance is given, all cells with a distance smaller than
110 minimum_distance will be set to NULL.
111
112 If maximum_distance is given, all cells with a distance larger than
113 maximum_distance will be set to NULL. The resultant output is equiva‐
114 lent to a buffer.
115
116 If both minimum_distance and maximum_distance are given, the result
117 will be similar to a doughnut, a restricted belt for a given distance
118 range. All cells outside this distance range will be set to NULL.
119
121 Distance from the streams network
122 North Carolina sample dataset:
123 g.region raster=streams_derived -p
124 r.grow.distance input=streams_derived distance=dist_from_streams
125 r.colors map=dist_from_streams color=rainbow
126 Euclidean distance from the streams network in meters (map subset)
127 Euclidean distance from the streams network in meters (detail, numbers
128 shown with d.rast.num)
129
130 Distance from sea in meters in latitude-longitude location
131 g.region raster=sea -p
132 r.grow.distance -m input=sea distance=dist_from_sea_geodetic metric=geodesic
133 r.colors map=dist_from_sea_geodetic color=rainbow
134
135 Geodesic distances to sea in meters
136
138 r.grow, r.distance, r.buffer, r.cost, r.patch
139
140 Wikipedia Entry: Euclidean Metric
141 Wikipedia Entry: Manhattan Metric
142
144 Glynn Clements
145
147 Available at: r.grow.distance source code (history)
148
149 Accessed: Saturday Oct 28 18:17:32 2023
150
151 Main index | Raster index | Topics index | Keywords index | Graphical
152 index | Full index
153
154 © 2003-2023 GRASS Development Team, GRASS GIS 8.3.1 Reference Manual
155
156
157
158GRASS 8.3.1 r.grow.distance(1)