[postgis-commits] svn - r3605 - in trunk: liblwgeom regress

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Sun Feb 1 22:01:28 PST 2009


Author: mleslie
Date: 2009-02-01 22:01:27 -0800 (Sun, 01 Feb 2009)
New Revision: 3605

Modified:
   trunk/liblwgeom/lwsegmentize.c
   trunk/regress/sql-mm-general.sql
   trunk/regress/sql-mm-general_expected
Log:
Fix for Issue 108 and regress test.

Modified: trunk/liblwgeom/lwsegmentize.c
===================================================================
--- trunk/liblwgeom/lwsegmentize.c	2009-02-02 04:19:01 UTC (rev 3604)
+++ trunk/liblwgeom/lwsegmentize.c	2009-02-02 06:01:27 UTC (rev 3605)
@@ -608,13 +608,14 @@
                 newPoints = ptarray_construct(TYPE_HASZ(pts->dims), TYPE_HASM(pts->dims), pts->npoints + line->points->npoints - 1);
                 for(i=0; i<line->points->npoints; i++)
                 {
-                        getPoint4d_p(pts, i, &pt);
+                        getPoint4d_p(line->points, i, &pt);
+						LWDEBUGF(5, "copying to %p [%d]", newPoints, i);
                         setPoint4d(newPoints, i, &pt);
                 }
                 for(i=1; i<pts->npoints; i++)
                 {
-                        getPoint4d_p(line->points, i, &pt);
-                        setPoint4d(newPoints, i + pts->npoints, &pt);
+                        getPoint4d_p(pts, i, &pt);
+                        setPoint4d(newPoints, i + line->points->npoints - 1, &pt);
                 }
                 result = (LWGEOM *)lwline_construct(SRID, NULL, newPoints);
                 lwgeom_release(geom);

Modified: trunk/regress/sql-mm-general.sql
===================================================================
--- trunk/regress/sql-mm-general.sql	2009-02-02 04:19:01 UTC (rev 3604)
+++ trunk/regress/sql-mm-general.sql	2009-02-02 06:01:27 UTC (rev 3605)
@@ -75,4 +75,12 @@
                 8 12 7 8,
                 7 10 7 8,
                 9 9 7 8)))'));
-
+SELECT ST_AsEWKT(ST_LineToCurve('LINESTRING(
+		-13151357.927248 3913656.64539871,
+		-13151419.0845266 3913664.12016378,
+		-13151441.323537 3913666.61175286,
+		-13151456.8908442 3913666.61175286,
+		-13151476.9059536 3913666.61175286,
+		-13151496.921063 3913666.61175287,
+		-13151521.3839744 3913666.61175287,
+		-13151591.4368571 3913665.36595828)'));

Modified: trunk/regress/sql-mm-general_expected
===================================================================
--- trunk/regress/sql-mm-general_expected	2009-02-02 04:19:01 UTC (rev 3604)
+++ trunk/regress/sql-mm-general_expected	2009-02-02 06:01:27 UTC (rev 3605)
@@ -11,3 +11,4 @@
 f
 f
 t
+LINESTRING(-13151357.927248 3913656.64539871,-13151419.0845266 3913664.12016378,-13151441.323537 3913666.61175286,-13151456.8908442 3913666.61175286,-13151476.9059536 3913666.61175286,-13151496.921063 3913666.61175287,-13151521.3839744 3913666.61175287,-13151591.4368571 3913665.36595828)



More information about the postgis-commits mailing list