浏览代码

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 年之前
父节点
当前提交
976bada6eb
共有 1 个文件被更改,包括 20 次插入10 次删除
  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',