[GRASS-SVN] r42142 - grass/trunk/scripts/r.fillnulls

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 7 07:39:55 EDT 2010


Author: mmetz
Date: 2010-05-07 07:39:54 -0400 (Fri, 07 May 2010)
New Revision: 42142

Modified:
   grass/trunk/scripts/r.fillnulls/r.fillnulls.py
Log:
fix for r.fillnulls: use r.grow instead of r.buffer

Modified: grass/trunk/scripts/r.fillnulls/r.fillnulls.py
===================================================================
--- grass/trunk/scripts/r.fillnulls/r.fillnulls.py	2010-05-07 08:06:32 UTC (rev 42141)
+++ grass/trunk/scripts/r.fillnulls/r.fillnulls.py	2010-05-07 11:39:54 UTC (rev 42142)
@@ -117,10 +117,15 @@
     # With just a single row of cells around the hole you often get gaps
     # around the edges when distance > mean (.5 of the time? diagonals? worse 
     # when ewres!=nsres).
-    reg = grass.region()
-    res = (float(reg['nsres']) + float(reg['ewres'])) * 3 / 2
+    # r.buffer broken in trunk for latlon, disabled
 
-    if grass.run_command('r.buffer', input = tmp1, distances = res, out = tmp1 + '.buf') != 0:
+    #reg = grass.region()
+    #res = (float(reg['nsres']) + float(reg['ewres'])) * 3 / 2
+
+    #if grass.run_command('r.buffer', input = tmp1, distances = res, out = tmp1 + '.buf') != 0:
+
+    # much easier way: use r.grow with radius=3.01
+    if grass.run_command('r.grow', input = tmp1, radius = 3.01, old = 1, new = 2, out = tmp1 + '.buf') != 0:
 	grass.fatal(_("abandoned. Removing temporary map, restoring user mask if needed:"))
 
     grass.mapcalc("MASK=if($tmp1.buf==2,1,null())", tmp1 = tmp1)



More information about the grass-commit mailing list