فهرست منبع

fix for r.fillnulls: use r.grow instead of r.buffer

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42142 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 سال پیش
والد
کامیت
0c406d4809
1فایلهای تغییر یافته به همراه8 افزوده شده و 3 حذف شده
  1. 8 3
      scripts/r.fillnulls/r.fillnulls.py

+ 8 - 3
scripts/r.fillnulls/r.fillnulls.py

@@ -117,10 +117,15 @@ def main():
     # 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)