[GRASS-SVN] r42126 - grass/branches/releasebranch_6_4/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 5 12:45:08 EDT 2010


Author: mmetz
Date: 2010-05-05 12:45:08 -0400 (Wed, 05 May 2010)
New Revision: 42126

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

Modified: grass/branches/releasebranch_6_4/vector/v.generalize/smoothing.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.generalize/smoothing.c	2010-05-05 16:44:41 UTC (rev 42125)
+++ grass/branches/releasebranch_6_4/vector/v.generalize/smoothing.c	2010-05-05 16:45:08 UTC (rev 42126)
@@ -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