Skip to content

Commit

Permalink
r.buffer/r.buffer.lowmem: manual page clean up
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54528 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
landam committed Jan 4, 2013
1 parent d2bb946 commit 2ae4fe8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 120 deletions.
2 changes: 1 addition & 1 deletion raster/r.buffer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int main(int argc, char *argv[])
G_add_keyword(_("raster"));
G_add_keyword(_("buffer"));
module->description =
_("Creates a raster map layer showing buffer zones "
_("Creates a raster map showing buffer zones "
"surrounding cells that contain non-NULL category values.");

opt1 = G_define_standard_option(G_OPT_R_INPUT);
Expand Down
65 changes: 31 additions & 34 deletions raster/r.buffer/r.buffer.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h2>DESCRIPTION</h2>

<em>r.buffer</em> creates a new raster map layer showing
<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 layer. The distances of buffer zones from cells
raster map. The distances of buffer zones from cells
with non-zero category values are user-chosen. Suppose,
for example, that you want to place buffer zones around
roads. This program could create the raster map layer
roads. This program could create the raster map
shown below on the right based on road information
contained in the raster map layer shown on the left.
contained in the raster map shown on the left.

<div class="code"><pre>
000000000000000000000000 222233333333333333444444
Expand All @@ -27,20 +27,17 @@ <h2>DESCRIPTION</h2>
Category 3: Buffer Zone 2 around roads
Category 4: Buffer Zone 3 around roads
</pre></div>
<br>


<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 <tt>0</tt> 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 <tt>0</tt> as its lower
bound.) Buffer distances can be specified using one of five units with the <em>
units</em> parameter: <em>meters, kilometers, feet, miles</em>, and <em>nautmiles</em>
(nautical miles).
The zones are identified by specifying the upper limit of each desired
zone (<em>r.buffer</em> assumes that <tt>0</tt> 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 <tt>0</tt> 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
Expand All @@ -57,23 +54,24 @@ <h2>NOTES</h2>
planimetric locations (like UTM) and using ellipsoidal
geodesic distance measure for latitude/longitude locations.
<p>
<em>r.buffer</em> calculates distance zones from all cells having non-NULL
category values in the <em>input</em> map. If the user wishes to calculate
distances from only selected <em>input</em> map layer
category values, the user should run (for example)
<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>r.buffer.lowmem</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.
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>
Expand All @@ -82,13 +80,13 @@ <h2>EXAMPLE</h2>
of meters): 0-100, 101-200, 201-300, 301-400 and 401-500.
<br>
<div class="code"><pre>
<b>r.buffer input=</b>roads <b>output=</b>roads.buf <b>distances=</b>100,200,300,400,500
r.buffer input=roads output=roads.buf distances=100,200,300,400,500
</pre></div>

Result:

<div class="code"><pre>
<b>r.category input=</b>roads.buf
r.category input=roads.buf

1 distances calculated from these locations
2 0-100 meters
Expand All @@ -98,19 +96,17 @@ <h2>EXAMPLE</h2>
6 400-500 meters
</pre></div>


<h2>SEE ALSO</h2>

<em>
<a href="g.region.html">g.region</a><br>
<a href="r.buffer.lowmem.html">r.buffer.lowmem</a><br>
<a href="r.cost.html">r.cost</a><br>
<a href="r.mapcalc.html">r.mapcalc</a><br>
<a href="r.reclass.html">r.reclass</a><br>
<a href="g.region.html">g.region</a>,
<a href="r.buffer.lowmem.html">r.buffer.lowmem</a>,
<a href="r.cost.html">r.cost</a>,
<a href="r.mapcalc.html">r.mapcalc</a>,
<a href="r.reclass.html">r.reclass</a>,
<a href="v.buffer.html">v.buffer</a>
</em>


<h2>AUTHORS</h2>

Michael Shapiro, U.S. Army Construction Engineering
Expand All @@ -119,4 +115,5 @@ <h2>AUTHORS</h2>
James Westervelt, U.S. Army Construction Engineering
Research Laboratory

<p><i>Last changed: $Date$</i>
<p>
<i>Last changed: $Date$</i>
106 changes: 22 additions & 84 deletions scripts/r.buffer.lowmem/r.buffer.lowmem.html
Original file line number Diff line number Diff line change
@@ -1,96 +1,35 @@
<h2>DESCRIPTION</h2>

<em>r.buffer.lowmem</em> creates a new raster map layer showing
buffer (a.k.a. "distance" or "proximity") zones around all
cells that contain non-NULL category values in an existing
raster map layer. The distances of buffer zones from cells
with non-zero category values are user-chosen.
<em>r.buffer.lowmem</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.

<p>
This is the low-memory alternative to the classic <em>r.buffer</em>
module. It is much slower than the classic version, but will
run on massive raster maps without using a lot of RAM. If your
raster map is larger than 32000x32000 cells on a system with
1 GB of RAM, or larger than 90000x90000 cells on a system with
8 GB of RAM, consider using this module.
This is the low-memory alternative to the
classic <em><a href="r.buffer.html">r.buffer</a></em> module. It is
much slower than the classic version, but will run on massive raster
maps without using a lot of RAM. If your raster map is larger than
32000x32000 cells on a system with 1 GB of RAM, or larger than
90000x90000 cells on a system with 8 GB of RAM, consider using this
module.

<p>
Suppose,
for example, that you want to place buffer zones around
roads. This program could create the raster map layer
shown below on the right based on road information
contained in the raster map layer shown on the left.
For more info see manual of <em><a href="r.buffer.html">r.buffer</a></em>.

<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>
<br>

<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 <tt>0</tt> 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 <tt>0</tt> as its lower
bound.) Buffer distances can be specified using one of five units with the <em>
units</em> parameter: <em>meters, kilometers, feet, miles</em>, and <em>nautmiles</em>
(nautical miles).
<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 locations (like UTM) and using ellipsoidal
geodesic distance measure for latitude/longitude locations.
<p>
<em>r.buffer</em> calculates distance zones from all cells having non-NULL
category values in the <em>input</em> map. If the user wishes to calculate
distances from only selected <em>input</em> map layer
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>
<h2>EXAMPLE</h2>

In the following example, the buffer zones would be (in the default units
of meters): 0-100, 101-200, 201-300, 301-400 and 401-500.
<br>
of meters): 0-100, 101-200, 201-300, 301-400 and 401-500.

<div class="code"><pre>
<b>r.buffer input=</b>roads <b>output=</b>roads.buf <b>distances=</b>100,200,300,400,500
r.buffer.lowmem input=roads output=roads.buf distances=100,200,300,400,500
</pre></div>

Result:

<div class="code"><pre>
<b>r.category input=</b>roads.buf
r.category input=roads.buf

1 distances calculated from these locations
2 0-100 meters
Expand All @@ -103,16 +42,15 @@ <h2>EXAMPLE</h2>
<h2>SEE ALSO</h2>

<em>
<a href="g.region.html">g.region</a><br>
<a href="r.buffer.html">r.buffer</a><br>
<a href="r.cost.html">r.cost</a><br>
<a href="r.grow.distance.html">r.grow.distance</a><br>
<a href="r.mapcalc.html">r.mapcalc</a><br>
<a href="r.reclass.html">r.reclass</a><br>
<a href="g.region.html">g.region</a>,
<a href="r.buffer.html">r.buffer</a>,
<a href="r.cost.html">r.cost</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>,
<a href="v.buffer.html">v.buffer</a>
</em>


<h2>AUTHORS</h2>

Michael Shapiro, U.S. Army Construction Engineering
Expand Down
3 changes: 2 additions & 1 deletion scripts/r.buffer.lowmem/r.buffer.lowmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#############################################################################

#%module
#% description: Creates a raster map showing buffer zones surrounding cells that contain non-NULL category values.
#% label: Creates a raster map showing buffer zones surrounding cells that contain non-NULL category values.
#% description: This is the low-memory alternative to the classic r.buffer module.
#% keywords: raster
#% keywords: buffer
#%end
Expand Down

0 comments on commit 2ae4fe8

Please sign in to comment.