|
@@ -6,10 +6,11 @@
|
|
|
* AUTHOR(S): Radim Blazek
|
|
|
* Upgraded by Rosen Matev (Google Summer of Code 2008)
|
|
|
* OGR support by Martin Landa <landa.martin gmail.com> (2009)
|
|
|
+ * rewrite and GEOS added by Markus Metz
|
|
|
*
|
|
|
* PURPOSE: Vector buffer
|
|
|
*
|
|
|
- * COPYRIGHT: (C) 2001-2009 by the GRASS Development Team
|
|
|
+ * COPYRIGHT: (C) 2001-2012 by the GRASS Development Team
|
|
|
*
|
|
|
* This program is free software under the GNU General
|
|
|
* Public License (>=v2). Read the file COPYING that
|
|
@@ -346,7 +347,7 @@ int main(int argc, char *argv[])
|
|
|
else
|
|
|
dalpha = 0;
|
|
|
|
|
|
- unit_tolerance = tolerance * MIN(da, db);
|
|
|
+ unit_tolerance = fabs(tolerance * MIN(da, db));
|
|
|
G_verbose_message(_("The tolerance in map units = %g"), unit_tolerance);
|
|
|
}
|
|
|
|
|
@@ -445,6 +446,12 @@ int main(int argc, char *argv[])
|
|
|
int ltype;
|
|
|
|
|
|
G_message(_("Buffering lines..."));
|
|
|
+
|
|
|
+ if (da < 0 || db < 0) {
|
|
|
+ G_warning(_("Negative distances are only supported for areas"));
|
|
|
+ da = fabs(da);
|
|
|
+ db = fabs(db);
|
|
|
+ }
|
|
|
|
|
|
nlines = Vect_get_num_lines(&In);
|
|
|
for (line = 1; line <= nlines; line++) {
|
|
@@ -481,6 +488,10 @@ int main(int argc, char *argv[])
|
|
|
continue;
|
|
|
|
|
|
da = size_val * scale;
|
|
|
+ if (da < 0) {
|
|
|
+ G_warning(_("Negative distances are only supported for areas"));
|
|
|
+ da = fabs(da);
|
|
|
+ }
|
|
|
db = da;
|
|
|
dalpha = 0;
|
|
|
unit_tolerance = tolerance * MIN(da, db);
|