Bläddra i källkod

v.buffer: warn if old options are used with GEOS buffering, update manual

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71724 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 år sedan
förälder
incheckning
bf6fea9fe3
2 ändrade filer med 23 tillägg och 5 borttagningar
  1. 19 5
      vector/v.buffer/main.c
  2. 4 0
      vector/v.buffer/v.buffer.html

+ 19 - 5
vector/v.buffer/main.c

@@ -288,9 +288,8 @@ int main(int argc, char *argv[])
     tol_opt->key = "tolerance";
     tol_opt->type = TYPE_DOUBLE;
     tol_opt->required = NO;
-    tol_opt->answer = "0.01";
     tol_opt->description =
-	_("Maximum distance between theoretical arc and polygon segments as multiple of buffer");
+	_("Maximum distance between theoretical arc and polygon segments as multiple of buffer (default 0.01)");
     tol_opt->guisection = _("Distance");
 
     straight_flag = G_define_flag();
@@ -358,9 +357,12 @@ int main(int argc, char *argv[])
     if (bufcol_opt->answer && field == -1)
 	G_fatal_error(_("The bufcol option requires a valid layer."));
 
-    tolerance = atof(tol_opt->answer);
-    if (tolerance <= 0)
-	G_fatal_error(_("The tolerance must be > 0."));
+    tolerance = 0.01;
+    if (tol_opt->answer) {
+	tolerance = atof(tol_opt->answer);
+	if (tolerance <= 0)
+	    G_fatal_error(_("The tolerance must be > 0."));
+    }
 
     if (adjust_tolerance(&tolerance))
 	G_warning(_("The tolerance was reset to %g"), tolerance);
@@ -385,6 +387,18 @@ int main(int argc, char *argv[])
 
 	unit_tolerance = fabs(tolerance * MIN(da, db));
 	G_verbose_message(_("The tolerance in map units = %g"), unit_tolerance);
+
+	if (use_geos) {
+	    if (distb_opt->answer)
+		G_warning(_("Option '%s' is not available with GEOS buffering"),
+			  distb_opt->key);
+	    if (dalpha != 0)
+		G_warning(_("Option '%s' is not available with GEOS buffering"),
+			  angle_opt->key);
+	    if (tol_opt->answer)
+		G_warning(_("Option '%s' is not available with GEOS buffering"),
+			  tol_opt->key);
+	}
     }
 
     if (Vect_open_new(&Out, out_opt->answer, WITHOUT_Z) < 0)

+ 4 - 0
vector/v.buffer/v.buffer.html

@@ -36,6 +36,10 @@ variable</a> <tt>GRASS_VECTOR_BUFFER</tt> is defined, then GRASS
 generates buffers using built-in buffering algorithm (which is still
 buggy for some input data).
 
+<p>
+The options <b>minordistance</b>, <b>angle</b>, <b>tolerance</b> are 
+kept for backward compatibility and have no effect with GEOS buffering.
+
 <h3>Corner settings</h3>
 
 The following vector line related corners (also called "cap") exist: