File: r.buffer.html

package info (click to toggle)
grass 8.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 277,040 kB
  • sloc: ansic: 460,798; python: 227,732; cpp: 42,026; sh: 11,262; makefile: 7,007; xml: 3,637; sql: 968; lex: 520; javascript: 484; yacc: 450; asm: 387; perl: 157; sed: 25; objc: 6; ruby: 4
file content (128 lines) | stat: -rw-r--r-- 4,849 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<h2>DESCRIPTION</h2>

<em>r.buffer</em> creates a new raster map showing
buffer (a.k.a. "distance" or "proximity") zones around all
cells that contain non-NULL category values in an existing
raster map. The distances of buffer zones from cells with
non-zero category values are user-chosen and must be positive value(s).
Suppose, for example, that you want to place buffer zones around
roads.  This program could create the raster map
shown below on the right based on road information
contained in the raster map shown on the left.

<div class="code"><pre>
      000000000000000000000000 222233333333333333444444
      111000000000000000000000 111222222222223333333333
      000111111111100000000000 222111111111122223333333
      000000001000011100000000 332222221222211122222222
      000000001000000011111111 333333321233222211111111
      000000001000000000000000 433333321233333222222222
      000000001000000000000000 444443321233333333333333
      000000001000000000000000 444443321233443333333333
      000000001000000000000000 444443321233444444444444

      Category 0: No roads
      Category 1: Road location
      Category 2: Buffer Zone 1 around roads
      Category 3: Buffer Zone 2 around roads
      Category 4: Buffer Zone 3 around roads
</pre></div>

<h2>NOTES</h2>

The user has the option of identifying up to 250 continuous zones.
The zones are identified by specifying the upper limit of each desired
zone (<em>r.buffer</em> assumes that <code>0</code> is the starting
point).  "Continuous" is used in the sense that each category zone's
lower value is the previous zone's upper value. The first buffer zone
always has distance <code>0</code> as its lower bound. Buffer distances
can be specified using one of five units with the <b>units</b> parameter.

<p>
<!-- ??? is this the real method used or some ancient option ??? -->
Distances from cells containing the user-specified category values
are calculated using the "fromcell" method. This method locates each
cell that contains a category value from which distances are to be
calculated, and draws the requested distance rings around
them. This method works very fast when there are few cells
containing the category values of interest, but works
slowly when there are numerous cells containing the
category values of interest spread throughout the area.
<p>
<em>r.buffer</em> measures distances from center of cell to
center of cell using Euclidean distance measure for
planimetric coordinate reference systems (like UTM) and using ellipsoidal
geodesic distance measure for latitude/longitude CRS.
<p>
<em>r.buffer</em> calculates distance zones from all cells having
non-NULL category values in the <b>input</b> map. If the user wishes
to calculate distances from only selected <b>input</b> map category
values, the user should run (for example)
<em><a href="r.reclass.html">r.reclass</a></em> prior to
<em>r.buffer</em>, to reclass all categories from which distance zones
are not desired to be calculated into category NULL.
<p>
The <b>-z</b> flag can be used to ignore raster values of zero instead of NULL
values in the input raster map.
<p>
When working with massive raster regions consider
the <em><a href="r.buffer.lowmem.html">r.buffer.lowmem</a></em> module
if RAM use becomes a problem. The lowmem version can be &gt; 40x
slower, but will work with minimal memory requirements. The
classic <em>r.buffer</em> should be able to deal with raster maps of
32000x32000 size on a system with 1 GB RAM, and rasters of 90000x90000
on a system with 8 GB RAM without going into swap.

<h2>EXAMPLE</h2>

In the following example (North Carolina sample dataset), the buffer zones
would be (in the default map units of meters):  0-100, 101-200, 201-300,
301-400 and 401-500.
<br>
<div class="code"><pre>
g.region raster=roadsmajor -p
r.buffer input=roadsmajor output=roadsmajor_buf distances=100,200,300,400,500
</pre></div>

Result:

<div class="code"><pre>
r.category input=roads.buf
      1       distances calculated from these locations
      2       0-100 meters
      3       100-200 meters
      4       200-300 meters
      5       300-400 meters
      6       400-500 meters
</pre></div>

<center>
<img src="r_buffer_road.png" border="1"><br>
<i>Distances to road</i>
</center>

<h2>SEE ALSO</h2>

<em>
<a href="r.buffer.lowmem.html">r.buffer.lowmem</a>,
<a href="r.grow.html">r.grow</a>,
<a href="v.buffer.html">v.buffer</a>
</em>

<p>
<em>
<a href="g.region.html">g.region</a>,
<a href="r.cost.html">r.cost</a>,
<a href="r.distance.html">r.distance</a>,
<a href="r.grow.distance.html">r.grow.distance</a>,
<a href="r.mapcalc.html">r.mapcalc</a>,
<a href="r.reclass.html">r.reclass</a>
</em>

<h2>AUTHORS</h2>

Michael Shapiro, U.S. Army Construction Engineering
Research Laboratory
<br>
James Westervelt, U.S. Army Construction Engineering
Research Laboratory