[GRASS-SVN] r47239 - grass/branches/develbranch_6/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 25 12:35:11 EDT 2011


Author: neteler
Date: 2011-07-25 09:35:11 -0700 (Mon, 25 Jul 2011)
New Revision: 47239

Modified:
   grass/branches/develbranch_6/vector/v.generalize/description.html
   grass/branches/develbranch_6/vector/v.generalize/main.c
Log:
fix if parameter is required or not; NC examples added

Modified: grass/branches/develbranch_6/vector/v.generalize/description.html
===================================================================
--- grass/branches/develbranch_6/vector/v.generalize/description.html	2011-07-25 16:35:01 UTC (rev 47238)
+++ grass/branches/develbranch_6/vector/v.generalize/description.html	2011-07-25 16:35:11 UTC (rev 47239)
@@ -81,24 +81,26 @@
 <i>Douglas-Peucker</i> and <i>Douglas-Peucker Reduction Algorithm</i> 
 use the same method to simplify the lines. Note that 
 <div class="code"><pre>
-v.generalize input=in output=out method=douglas threshold=eps
+v.generalize input=boundary_county output=boundary_county_dp20 method=douglas threshold=20
 </pre></div>
 is equivalent to
 <div class="code"><pre>
-v.generalize input=in output=out method=douglas_reduction threshold=eps reduction=100
+v.generalize input=boundary_county output=boundary_county_dp_red20_100 \
+             method=douglas_reduction threshold=20 reduction=100
 </pre></div>
 However, in this case, the first method is faster. Also observe that
 <i>douglas_reduction</i> never outputs more vertices than <i>douglas</i>,
 and that, in general, <i>douglas</i> is more efficient than 
 <i>douglas_reduction</i>. More importantly, the effect of
 <div class="code"><pre>
-v.generalize input=in output=out method=douglas_reduction threshold=0 reduction=X
+v.generalize input=boundary_county output=boundary_county_dp_red0_30 \
+             method=douglas_reduction threshold=0 reduction=30
 </pre></div>
-is that 'out' contains approximately only X% of points of 'in'.
+is that 'out' contains approximately only 30% of points of 'in'.
 
 <h3>SMOOTHING</h3>
 
-The following smoothing algorithms are implemented in <em>v.generalize</em>
+The following smoothing algorithms are implemented in <em>v.generalize</em>:
 
 <ul>
 <li><i>Boyle's Forward-Looking Algorithm</i> - The position of each point 

Modified: grass/branches/develbranch_6/vector/v.generalize/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.generalize/main.c	2011-07-25 16:35:01 UTC (rev 47238)
+++ grass/branches/develbranch_6/vector/v.generalize/main.c	2011-07-25 16:35:11 UTC (rev 47239)
@@ -91,7 +91,6 @@
     method_opt->multiple = NO;
     method_opt->options =
 	"douglas,douglas_reduction,lang,reduction,reumann,boyle,sliding_averaging,distance_weighting,chaiken,hermite,snakes,network,displacement";
-    method_opt->answer = "douglas";
     method_opt->descriptions = _("douglas;Douglas-Peucker Algorithm;"
 				 "douglas_reduction;Douglas-Peucker Algorithm with reduction parameter;"
 				 "lang;Lang Simplification Algorithm;"
@@ -113,20 +112,19 @@
     thresh_opt->type = TYPE_DOUBLE;
     thresh_opt->required = YES;
     thresh_opt->options = "0-1000000000";
-    thresh_opt->answer = "1.0";
     thresh_opt->description = _("Maximal tolerance value");
 
     look_ahead_opt = G_define_option();
     look_ahead_opt->key = "look_ahead";
     look_ahead_opt->type = TYPE_INTEGER;
-    look_ahead_opt->required = YES;
+    look_ahead_opt->required = NO;
     look_ahead_opt->answer = "7";
     look_ahead_opt->description = _("Look-ahead parameter");
 
     reduction_opt = G_define_option();
     reduction_opt->key = "reduction";
     reduction_opt->type = TYPE_DOUBLE;
-    reduction_opt->required = YES;
+    reduction_opt->required = NO;
     reduction_opt->answer = "50";
     reduction_opt->options = "0-100";
     reduction_opt->description =
@@ -135,7 +133,7 @@
     slide_opt = G_define_option();
     slide_opt->key = "slide";
     slide_opt->type = TYPE_DOUBLE;
-    slide_opt->required = YES;
+    slide_opt->required = NO;
     slide_opt->answer = "0.5";
     slide_opt->options = "0-1";
     slide_opt->description =
@@ -144,7 +142,7 @@
     angle_thresh_opt = G_define_option();
     angle_thresh_opt->key = "angle_thresh";
     angle_thresh_opt->type = TYPE_DOUBLE;
-    angle_thresh_opt->required = YES;
+    angle_thresh_opt->required = NO;
     angle_thresh_opt->answer = "3";
     angle_thresh_opt->options = "0-180";
     angle_thresh_opt->description =
@@ -153,7 +151,7 @@
     degree_thresh_opt = G_define_option();
     degree_thresh_opt->key = "degree_thresh";
     degree_thresh_opt->type = TYPE_INTEGER;
-    degree_thresh_opt->required = YES;
+    degree_thresh_opt->required = NO;
     degree_thresh_opt->answer = "0";
     degree_thresh_opt->description =
 	_("Degree threshold in network generalization");
@@ -161,7 +159,7 @@
     closeness_thresh_opt = G_define_option();
     closeness_thresh_opt->key = "closeness_thresh";
     closeness_thresh_opt->type = TYPE_DOUBLE;
-    closeness_thresh_opt->required = YES;
+    closeness_thresh_opt->required = NO;
     closeness_thresh_opt->answer = "0";
     closeness_thresh_opt->options = "0-1";
     closeness_thresh_opt->description =
@@ -170,7 +168,7 @@
     betweeness_thresh_opt = G_define_option();
     betweeness_thresh_opt->key = "betweeness_thresh";
     betweeness_thresh_opt->type = TYPE_DOUBLE;
-    betweeness_thresh_opt->required = YES;
+    betweeness_thresh_opt->required = NO;
     betweeness_thresh_opt->answer = "0";
     betweeness_thresh_opt->description =
 	_("Betweeness threshold in network generalization");
@@ -178,21 +176,21 @@
     alpha_opt = G_define_option();
     alpha_opt->key = "alpha";
     alpha_opt->type = TYPE_DOUBLE;
-    alpha_opt->required = YES;
+    alpha_opt->required = NO;
     alpha_opt->answer = "1.0";
     alpha_opt->description = _("Snakes alpha parameter");
 
     beta_opt = G_define_option();
     beta_opt->key = "beta";
     beta_opt->type = TYPE_DOUBLE;
-    beta_opt->required = YES;
+    beta_opt->required = NO;
     beta_opt->answer = "1.0";
     beta_opt->description = _("Snakes beta parameter");
 
     iterations_opt = G_define_option();
     iterations_opt->key = "iterations";
     iterations_opt->type = TYPE_INTEGER;
-    iterations_opt->required = YES;
+    iterations_opt->required = NO;
     iterations_opt->answer = "1";
     iterations_opt->description = _("Number of iterations");
 



More information about the grass-commit mailing list