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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 13 16:56:35 EST 2012


Author: mmetz
Date: 2012-02-13 13:56:34 -0800 (Mon, 13 Feb 2012)
New Revision: 50803

Modified:
   grass/trunk/scripts/r.fillnulls/r.fillnulls.py
Log:
r.fillnulls: region fix

Modified: grass/trunk/scripts/r.fillnulls/r.fillnulls.py
===================================================================
--- grass/trunk/scripts/r.fillnulls/r.fillnulls.py	2012-02-13 16:26:10 UTC (rev 50802)
+++ grass/trunk/scripts/r.fillnulls/r.fillnulls.py	2012-02-13 21:56:34 UTC (rev 50803)
@@ -101,6 +101,9 @@
 
     #make a mask of NULL cells
     tmp1 = "r_fillnulls_" + unique
+    
+    # save original region
+    reg_org = grass.region()
 
     #check if method is rst to use v.surf.rst
     if method == 'rst':
@@ -167,7 +170,7 @@
         grass.use_temp_region()
         grass.run_command('g.region', vect = vecttmp, align = input)
 
-        # set the max number before segmantation
+        # set the max number before segmentation
         segmax = 600
         if pointsnumber > segmax:
             grass.message(_("Using segmentation for interpolation..."))
@@ -208,6 +211,10 @@
 	grass.message(_("Restoring user mask (MASK)..."))
 	grass.run_command('g.rename', quiet = True, rast = (usermask, 'MASK'))
 
+    # set region to original extents, align to input
+    grass.run_command('g.region', n = reg_org['n'], s = reg_org['s'], 
+		      e = reg_org['e'], w = reg_org['w'], align = input)
+
     # patch orig and fill map
     grass.message(_("Patching fill data into NULL areas..."))
     # we can use --o here as g.parser already checks on startup



More information about the grass-commit mailing list