[GRASS-SVN] r42124 - grass/trunk/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 5 12:43:53 EDT 2010


Author: mmetz
Date: 2010-05-05 12:43:52 -0400 (Wed, 05 May 2010)
New Revision: 42124

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

Modified: grass/trunk/vector/v.generalize/smoothing.c
===================================================================
--- grass/trunk/vector/v.generalize/smoothing.c	2010-05-05 14:08:55 UTC (rev 42123)
+++ grass/trunk/vector/v.generalize/smoothing.c	2010-05-05 16:43:52 UTC (rev 42124)
@@ -212,8 +212,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)
@@ -235,7 +236,7 @@
 		point_scalar(tmp, 0.5, &p1);
 	    }
 	    else {
-		break;		/* good approximatin */
+		break;		/* good approximation */
 	    }
 	}
 
@@ -246,7 +247,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