[GRASS-SVN] r30050 - grass/trunk/vector/v.generalize
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 10 03:56:28 EST 2008
Author: hamish
Date: 2008-02-10 03:56:27 -0500 (Sun, 10 Feb 2008)
New Revision: 30050
Modified:
grass/trunk/vector/v.generalize/smoothing.c
Log:
fix for bug #36: patch from Daniel Bundala (bundala gmail com)
Modified: grass/trunk/vector/v.generalize/smoothing.c
===================================================================
--- grass/trunk/vector/v.generalize/smoothing.c 2008-02-10 07:57:28 UTC (rev 30049)
+++ grass/trunk/vector/v.generalize/smoothing.c 2008-02-10 08:56:27 UTC (rev 30050)
@@ -258,7 +258,12 @@
void refine_tangent(POINT * p)
{
double l = point_dist2(*p);
- point_scalar(*p, (double)1.0 / sqrt(sqrt(sqrt(l))), p);
+ if (l < 1e-12) {
+ point_scalar(*p, 0.0, p);
+ }
+ else {
+ point_scalar(*p, (double)1.0 / sqrt(sqrt(sqrt(l))), p);
+ }
return;
}
@@ -281,7 +286,7 @@
/* line is too short */
if (n <= 2) {
- return 1;
+ return n;
}
/* convert degrees=>radians */
More information about the grass-commit
mailing list