[GRASS-SVN] r71725 - grass/branches/releasebranch_7_4/vector/v.buffer

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 12 14:40:40 PST 2017


Author: mmetz
Date: 2017-11-12 14:40:40 -0800 (Sun, 12 Nov 2017)
New Revision: 71725

Modified:
   grass/branches/releasebranch_7_4/vector/v.buffer/main.c
   grass/branches/releasebranch_7_4/vector/v.buffer/v.buffer.html
Log:
v.buffer: warn if old options are used with GEOS buffering, update manual (backport trunk r71724)

Modified: grass/branches/releasebranch_7_4/vector/v.buffer/main.c
===================================================================
--- grass/branches/releasebranch_7_4/vector/v.buffer/main.c	2017-11-12 22:04:17 UTC (rev 71724)
+++ grass/branches/releasebranch_7_4/vector/v.buffer/main.c	2017-11-12 22:40:40 UTC (rev 71725)
@@ -288,9 +288,8 @@
     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 @@
     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 @@
 
 	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)

Modified: grass/branches/releasebranch_7_4/vector/v.buffer/v.buffer.html
===================================================================
--- grass/branches/releasebranch_7_4/vector/v.buffer/v.buffer.html	2017-11-12 22:04:17 UTC (rev 71724)
+++ grass/branches/releasebranch_7_4/vector/v.buffer/v.buffer.html	2017-11-12 22:40:40 UTC (rev 71725)
@@ -36,6 +36,10 @@
 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:



More information about the grass-commit mailing list