Преглед на файлове

Rename classic r.buffer back to its original name, rename the python
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

Hamish Bowman преди 13 години
родител
ревизия
23e0af15dc
променени са 6 файла, в които са добавени 35 реда и са изтрити 8 реда
  1. 1 1
      raster/r.buffer/Makefile
  2. 11 0
      scripts/r.buffer/r.buffer.html
  3. 1 1
      scripts/Makefile
  4. 1 1
      scripts/r.buffer/Makefile
  5. 19 3
      raster/r.buffer/r.buffer2.html
  6. 2 2
      scripts/r.buffer/r.buffer.py

+ 1 - 1
raster/r.buffer/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 MODULE_TOPDIR = ../..
 
 
-PGM = r.buffer2
+PGM = r.buffer
 
 
 LIBES = $(RASTERLIB) $(GISLIB)
 LIBES = $(RASTERLIB) $(GISLIB)
 DEPENDENCIES = $(RASTERDEP) $(GISDEP)
 DEPENDENCIES = $(RASTERDEP) $(GISDEP)

+ 11 - 0
scripts/r.buffer/r.buffer.html

@@ -29,6 +29,7 @@ contained in the raster map layer shown on the left.
 </pre></div>
 </pre></div>
 <br>
 <br>
 
 
+
 <h2>NOTES</h2>
 <h2>NOTES</h2>
 
 
 The user has the option of identifying up to 250 continuous zones.
 The user has the option of identifying up to 250 continuous zones.
@@ -67,6 +68,14 @@ are not desired to be calculated into category NULL.
 The <b>-z</b> flag can be used to ignore raster values of zero instead of NULL
 The <b>-z</b> flag can be used to ignore raster values of zero instead of NULL
 values in the input raster map.
 values in the input raster map.
 <p>
 <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>
 <h2>EXAMPLE</h2>
 
 
 In the following example, the buffer zones would be (in the default units
 In the following example, the buffer zones would be (in the default units
@@ -89,10 +98,12 @@ Result:
       6       400-500 meters
       6       400-500 meters
 </pre></div>
 </pre></div>
 
 
+
 <h2>SEE ALSO</h2>
 <h2>SEE ALSO</h2>
 
 
 <em>
 <em>
 <a href="g.region.html">g.region</a><br>
 <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.cost.html">r.cost</a><br>
 <a href="r.mapcalc.html">r.mapcalc</a><br>
 <a href="r.mapcalc.html">r.mapcalc</a><br>
 <a href="r.reclass.html">r.reclass</a><br>
 <a href="r.reclass.html">r.reclass</a><br>

+ 1 - 1
scripts/Makefile

@@ -25,7 +25,7 @@ SUBDIRS = \
 	i.tasscap \
 	i.tasscap \
 	m.proj \
 	m.proj \
 	r.blend \
 	r.blend \
-	r.buffer \
+	r.buffer.lowmem \
 	r.colors.stddev \
 	r.colors.stddev \
 	r.fillnulls \
 	r.fillnulls \
 	r.grow \
 	r.grow \

+ 1 - 1
scripts/r.buffer/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 MODULE_TOPDIR = ../..
 
 
-PGM = r.buffer
+PGM = r.buffer.lowmem
 
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 include $(MODULE_TOPDIR)/include/Make/Script.make
 
 

+ 19 - 3
raster/r.buffer/r.buffer2.html

@@ -1,10 +1,21 @@
 <h2>DESCRIPTION</h2>
 <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
 buffer (a.k.a. "distance" or "proximity") zones around all
 cells that contain non-NULL category values in an existing
 cells that contain non-NULL category values in an existing
 raster map layer.  The distances of buffer zones from cells
 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
 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 layer
 shown below on the right based on road information
 shown below on the right based on road information
@@ -93,7 +104,9 @@ Result:
 
 
 <em>
 <em>
 <a href="g.region.html">g.region</a><br>
 <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.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.mapcalc.html">r.mapcalc</a><br>
 <a href="r.reclass.html">r.reclass</a><br>
 <a href="r.reclass.html">r.reclass</a><br>
 <a href="v.buffer.html">v.buffer</a>
 <a href="v.buffer.html">v.buffer</a>
@@ -107,5 +120,8 @@ Research Laboratory
 <br>
 <br>
 James Westervelt, U.S. Army Construction Engineering 
 James Westervelt, U.S. Army Construction Engineering 
 Research Laboratory
 Research Laboratory
+<br>
+Low-memory Python version by Glynn Clements
 
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

+ 2 - 2
scripts/r.buffer/r.buffer.py

@@ -2,9 +2,9 @@
 #
 #
 ############################################################################
 ############################################################################
 #
 #
-# MODULE:	r.buffer
+# MODULE:	r.buffer.lowmem
 # AUTHOR(S):	Glynn Clements
 # 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
 # COPYRIGHT:	(C) 2008, 2010 by Glynn Clements
 #
 #