浏览代码

fix if parameter is required or not; NC examples added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47240 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 13 年之前
父节点
当前提交
8dfd47de38
共有 2 个文件被更改,包括 17 次插入17 次删除
  1. 10 12
      vector/v.generalize/main.c
  2. 7 5
      vector/v.generalize/v.generalize.html

+ 10 - 12
vector/v.generalize/main.c

@@ -100,7 +100,6 @@ int main(int argc, char *argv[])
     method_opt->multiple = NO;
     method_opt->multiple = NO;
     method_opt->options =
     method_opt->options =
 	"douglas,douglas_reduction,lang,reduction,reumann,boyle,sliding_averaging,distance_weighting,chaiken,hermite,snakes,network,displacement";
 	"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;"
     method_opt->descriptions = _("douglas;Douglas-Peucker Algorithm;"
 				 "douglas_reduction;Douglas-Peucker Algorithm with reduction parameter;"
 				 "douglas_reduction;Douglas-Peucker Algorithm with reduction parameter;"
 				 "lang;Lang Simplification Algorithm;"
 				 "lang;Lang Simplification Algorithm;"
@@ -122,20 +121,19 @@ int main(int argc, char *argv[])
     thresh_opt->type = TYPE_DOUBLE;
     thresh_opt->type = TYPE_DOUBLE;
     thresh_opt->required = YES;
     thresh_opt->required = YES;
     thresh_opt->options = "0-1000000000";
     thresh_opt->options = "0-1000000000";
-    thresh_opt->answer = "1.0";
     thresh_opt->description = _("Maximal tolerance value");
     thresh_opt->description = _("Maximal tolerance value");
 
 
     look_ahead_opt = G_define_option();
     look_ahead_opt = G_define_option();
     look_ahead_opt->key = "look_ahead";
     look_ahead_opt->key = "look_ahead";
     look_ahead_opt->type = TYPE_INTEGER;
     look_ahead_opt->type = TYPE_INTEGER;
-    look_ahead_opt->required = YES;
+    look_ahead_opt->required = NO;
     look_ahead_opt->answer = "7";
     look_ahead_opt->answer = "7";
     look_ahead_opt->description = _("Look-ahead parameter");
     look_ahead_opt->description = _("Look-ahead parameter");
 
 
     reduction_opt = G_define_option();
     reduction_opt = G_define_option();
     reduction_opt->key = "reduction";
     reduction_opt->key = "reduction";
     reduction_opt->type = TYPE_DOUBLE;
     reduction_opt->type = TYPE_DOUBLE;
-    reduction_opt->required = YES;
+    reduction_opt->required = NO;
     reduction_opt->answer = "50";
     reduction_opt->answer = "50";
     reduction_opt->options = "0-100";
     reduction_opt->options = "0-100";
     reduction_opt->description =
     reduction_opt->description =
@@ -144,7 +142,7 @@ int main(int argc, char *argv[])
     slide_opt = G_define_option();
     slide_opt = G_define_option();
     slide_opt->key = "slide";
     slide_opt->key = "slide";
     slide_opt->type = TYPE_DOUBLE;
     slide_opt->type = TYPE_DOUBLE;
-    slide_opt->required = YES;
+    slide_opt->required = NO;
     slide_opt->answer = "0.5";
     slide_opt->answer = "0.5";
     slide_opt->options = "0-1";
     slide_opt->options = "0-1";
     slide_opt->description =
     slide_opt->description =
@@ -153,7 +151,7 @@ int main(int argc, char *argv[])
     angle_thresh_opt = G_define_option();
     angle_thresh_opt = G_define_option();
     angle_thresh_opt->key = "angle_thresh";
     angle_thresh_opt->key = "angle_thresh";
     angle_thresh_opt->type = TYPE_DOUBLE;
     angle_thresh_opt->type = TYPE_DOUBLE;
-    angle_thresh_opt->required = YES;
+    angle_thresh_opt->required = NO;
     angle_thresh_opt->answer = "3";
     angle_thresh_opt->answer = "3";
     angle_thresh_opt->options = "0-180";
     angle_thresh_opt->options = "0-180";
     angle_thresh_opt->description =
     angle_thresh_opt->description =
@@ -162,7 +160,7 @@ int main(int argc, char *argv[])
     degree_thresh_opt = G_define_option();
     degree_thresh_opt = G_define_option();
     degree_thresh_opt->key = "degree_thresh";
     degree_thresh_opt->key = "degree_thresh";
     degree_thresh_opt->type = TYPE_INTEGER;
     degree_thresh_opt->type = TYPE_INTEGER;
-    degree_thresh_opt->required = YES;
+    degree_thresh_opt->required = NO;
     degree_thresh_opt->answer = "0";
     degree_thresh_opt->answer = "0";
     degree_thresh_opt->description =
     degree_thresh_opt->description =
 	_("Degree threshold in network generalization");
 	_("Degree threshold in network generalization");
@@ -170,7 +168,7 @@ int main(int argc, char *argv[])
     closeness_thresh_opt = G_define_option();
     closeness_thresh_opt = G_define_option();
     closeness_thresh_opt->key = "closeness_thresh";
     closeness_thresh_opt->key = "closeness_thresh";
     closeness_thresh_opt->type = TYPE_DOUBLE;
     closeness_thresh_opt->type = TYPE_DOUBLE;
-    closeness_thresh_opt->required = YES;
+    closeness_thresh_opt->required = NO;
     closeness_thresh_opt->answer = "0";
     closeness_thresh_opt->answer = "0";
     closeness_thresh_opt->options = "0-1";
     closeness_thresh_opt->options = "0-1";
     closeness_thresh_opt->description =
     closeness_thresh_opt->description =
@@ -179,7 +177,7 @@ int main(int argc, char *argv[])
     betweeness_thresh_opt = G_define_option();
     betweeness_thresh_opt = G_define_option();
     betweeness_thresh_opt->key = "betweeness_thresh";
     betweeness_thresh_opt->key = "betweeness_thresh";
     betweeness_thresh_opt->type = TYPE_DOUBLE;
     betweeness_thresh_opt->type = TYPE_DOUBLE;
-    betweeness_thresh_opt->required = YES;
+    betweeness_thresh_opt->required = NO;
     betweeness_thresh_opt->answer = "0";
     betweeness_thresh_opt->answer = "0";
     betweeness_thresh_opt->description =
     betweeness_thresh_opt->description =
 	_("Betweeness threshold in network generalization");
 	_("Betweeness threshold in network generalization");
@@ -187,21 +185,21 @@ int main(int argc, char *argv[])
     alpha_opt = G_define_option();
     alpha_opt = G_define_option();
     alpha_opt->key = "alpha";
     alpha_opt->key = "alpha";
     alpha_opt->type = TYPE_DOUBLE;
     alpha_opt->type = TYPE_DOUBLE;
-    alpha_opt->required = YES;
+    alpha_opt->required = NO;
     alpha_opt->answer = "1.0";
     alpha_opt->answer = "1.0";
     alpha_opt->description = _("Snakes alpha parameter");
     alpha_opt->description = _("Snakes alpha parameter");
 
 
     beta_opt = G_define_option();
     beta_opt = G_define_option();
     beta_opt->key = "beta";
     beta_opt->key = "beta";
     beta_opt->type = TYPE_DOUBLE;
     beta_opt->type = TYPE_DOUBLE;
-    beta_opt->required = YES;
+    beta_opt->required = NO;
     beta_opt->answer = "1.0";
     beta_opt->answer = "1.0";
     beta_opt->description = _("Snakes beta parameter");
     beta_opt->description = _("Snakes beta parameter");
 
 
     iterations_opt = G_define_option();
     iterations_opt = G_define_option();
     iterations_opt->key = "iterations";
     iterations_opt->key = "iterations";
     iterations_opt->type = TYPE_INTEGER;
     iterations_opt->type = TYPE_INTEGER;
-    iterations_opt->required = YES;
+    iterations_opt->required = NO;
     iterations_opt->answer = "1";
     iterations_opt->answer = "1";
     iterations_opt->description = _("Number of iterations");
     iterations_opt->description = _("Number of iterations");
 
 

+ 7 - 5
vector/v.generalize/v.generalize.html

@@ -81,24 +81,26 @@ the degree of simplification increases with the increasing value of
 <i>Douglas-Peucker</i> and <i>Douglas-Peucker Reduction Algorithm</i> 
 <i>Douglas-Peucker</i> and <i>Douglas-Peucker Reduction Algorithm</i> 
 use the same method to simplify the lines. Note that 
 use the same method to simplify the lines. Note that 
 <div class="code"><pre>
 <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>
 </pre></div>
 is equivalent to
 is equivalent to
 <div class="code"><pre>
 <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>
 </pre></div>
 However, in this case, the first method is faster. Also observe that
 However, in this case, the first method is faster. Also observe that
 <i>douglas_reduction</i> never outputs more vertices than <i>douglas</i>,
 <i>douglas_reduction</i> never outputs more vertices than <i>douglas</i>,
 and that, in general, <i>douglas</i> is more efficient than 
 and that, in general, <i>douglas</i> is more efficient than 
 <i>douglas_reduction</i>. More importantly, the effect of
 <i>douglas_reduction</i>. More importantly, the effect of
 <div class="code"><pre>
 <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>
 </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>
 <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>
 <ul>
 <li><i>Boyle's Forward-Looking Algorithm</i> - The position of each point 
 <li><i>Boyle's Forward-Looking Algorithm</i> - The position of each point