Browse Source

Allow user to adjust npmin and segmax values for RST interpolator.
High default values choosen to promote no segmentation for smaller holes as data around holes are not
uniformly distributed and thus prone to segment edge problem.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57020 15284696-431f-4ddb-bdfa-cd5b030d7da7

Maris Nartiss 12 years ago
parent
commit
976bada6eb
1 changed files with 20 additions and 10 deletions
  1. 20 10
      scripts/r.fillnulls/r.fillnulls.py

+ 20 - 10
scripts/r.fillnulls/r.fillnulls.py

@@ -58,6 +58,24 @@
 #% guisection: RST options
 #%end
 #%option
+#% key: npmin
+#% type: integer
+#% description: Minimum number of points for approximation in a segment (>segmax)
+#% required : no
+#% answer : 600
+#% options : 2-10000
+#% guisection: RST options
+#%end
+#%option
+#% key: segmax
+#% type: integer
+#% description: Maximum number of points in a segment
+#% required : no
+#% answer : 300
+#% options : 2-10000
+#% guisection: RST options
+#%end
+#%option
 #% key: method
 #% type: string
 #% description: Interpolation method
@@ -97,6 +115,8 @@ def main():
     smooth = options['smooth']
     method = options['method']
     edge = int(options['edge'])
+    segmax = int(options['segmax'])
+    npmin = int(options['npmin'])
     quiet = True # FIXME 
     
     mapset = grass.gisenv()['MAPSET']
@@ -248,16 +268,6 @@ def main():
                 failed_list.append(holename)
                 continue
             
-            grass.message(_("Note: The following warnings about number of points for interpolation may be ignored."))
-            
-            # set the max number before segmentation
-            # npmin and segmax values were choosen by fair guess and thus are superior to all other values ;)
-            segmax = 100
-            npmin = 300
-            if pointsnumber < 600:
-                npmin = pointsnumber
-                segmax = pointsnumber
-            
             # launch v.surf.rst
             tmp_rmaps.append(holename + '_dem')
             if grass.run_command('v.surf.rst', quiet = quiet, input = holename, elev = holename + '_dem',