[GRASS-SVN] r42125 - grass/branches/develbranch_6/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 5 12:44:41 EDT 2010


Author: mmetz
Date: 2010-05-05 12:44:41 -0400 (Wed, 05 May 2010)
New Revision: 42125

Modified:
   grass/branches/develbranch_6/vector/v.generalize/smoothing.c
Log:
chaiken forgot first point

Modified: grass/branches/develbranch_6/vector/v.generalize/smoothing.c
===================================================================
--- grass/branches/develbranch_6/vector/v.generalize/smoothing.c	2010-05-05 16:43:52 UTC (rev 42124)
+++ grass/branches/develbranch_6/vector/v.generalize/smoothing.c	2010-05-05 16:44:41 UTC (rev 42125)
@@ -211,8 +211,9 @@
 
     head.next = NULL;
     cur = &head;
-    point_assign(Points, 0, with_z, &head.p);
     point_assign(Points, 0, with_z, &p0);
+    point_list_add(cur, p0); /* always keep first point */
+    cur = cur->next;
 
     for (i = 2; i <= n; i++) {
 	if (i == n)
@@ -234,7 +235,7 @@
 		point_scalar(tmp, 0.5, &p1);
 	    }
 	    else {
-		break;		/* good approximatin */
+		break;		/* good approximation */
 	    }
 	}
 
@@ -245,7 +246,7 @@
     }
 
     point_assign(Points, n - 1, with_z, &p0);
-    point_list_add(cur, p0);
+    point_list_add(cur, p0); /* always keep last point */
 
     if (point_list_copy_to_line_pnts(head, Points) == -1) {
 	G_fatal_error(_("Out of memory"));



More information about the grass-commit mailing list