Skip to content

Commit

Permalink
Rename classic r.buffer back to its original name, rename the python
Browse files Browse the repository at this point in the history
version to "lowmem". Describe the alternatives in the help pages.
The classic C version runs more than 40x faster and memory only becomes 
an issue when the map size is abnormally massive. (32000x32000 cells on
a machine with 1 GB RAM, 90000x90000 cells on a machine with 8 GB RAM).


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52172 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
HamishB committed Jun 21, 2012
1 parent ee90584 commit 23e0af1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion raster/r.buffer/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MODULE_TOPDIR = ../..

PGM = r.buffer2
PGM = r.buffer

LIBES = $(RASTERLIB) $(GISLIB)
DEPENDENCIES = $(RASTERDEP) $(GISDEP)
Expand Down
11 changes: 11 additions & 0 deletions scripts/r.buffer/r.buffer.html → raster/r.buffer/r.buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2>DESCRIPTION</h2>
</pre></div>
<br>


<h2>NOTES</h2>

The user has the option of identifying up to 250 continuous zones.
Expand Down Expand Up @@ -67,6 +68,14 @@ <h2>NOTES</h2>
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.


<h2>EXAMPLE</h2>

In the following example, the buffer zones would be (in the default units
Expand All @@ -89,10 +98,12 @@ <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>
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SUBDIRS = \
i.tasscap \
m.proj \
r.blend \
r.buffer \
r.buffer.lowmem \
r.colors.stddev \
r.fillnulls \
r.grow \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MODULE_TOPDIR = ../..

PGM = r.buffer
PGM = r.buffer.lowmem

include $(MODULE_TOPDIR)/include/Make/Script.make

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<h2>DESCRIPTION</h2>

<em>r.buffer</em> creates a new raster map layer showing
<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. Suppose,
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.

<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
Expand Down Expand Up @@ -93,7 +104,9 @@ <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="v.buffer.html">v.buffer</a>
Expand All @@ -107,5 +120,8 @@ <h2>AUTHORS</h2>
<br>
James Westervelt, U.S. Army Construction Engineering
Research Laboratory
<br>
Low-memory Python version by Glynn Clements

<p><i>Last changed: $Date$</i>
<p>
<i>Last changed: $Date$</i>
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#
############################################################################
#
# MODULE: r.buffer
# MODULE: r.buffer.lowmem
# AUTHOR(S): Glynn Clements
# PURPOSE: Replacement for r.buffer using r.grow.distance
# PURPOSE: Low-memory replacement for r.buffer using r.grow.distance
#
# COPYRIGHT: (C) 2008, 2010 by Glynn Clements
#
Expand Down

0 comments on commit 23e0af1

Please sign in to comment.