From: Mark Leslie Date: Mon, 2 Feb 2009 06:01:27 +0000 (+0000) Subject: Fix for Issue 108 and regress test. X-Git-Tag: 1.4.0b1~259 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0974feec6bb11c54f74a3a9576062d9ba24316ed;p=postgis Fix for Issue 108 and regress test. git-svn-id: http://svn.osgeo.org/postgis/trunk@3605 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwsegmentize.c b/liblwgeom/lwsegmentize.c index 199c9ebda..bac0dbd27 100644 --- a/liblwgeom/lwsegmentize.c +++ b/liblwgeom/lwsegmentize.c @@ -608,13 +608,14 @@ append_segment(LWGEOM *geom, POINTARRAY *pts, int type, int SRID) newPoints = ptarray_construct(TYPE_HASZ(pts->dims), TYPE_HASM(pts->dims), pts->npoints + line->points->npoints - 1); for(i=0; ipoints->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; inpoints; 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); diff --git a/regress/sql-mm-general.sql b/regress/sql-mm-general.sql index d1de42bc8..898ef1eeb 100644 --- a/regress/sql-mm-general.sql +++ b/regress/sql-mm-general.sql @@ -75,4 +75,12 @@ SELECT ST_HasArc(geomfromewkt('MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING( 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)')); diff --git a/regress/sql-mm-general_expected b/regress/sql-mm-general_expected index 8fa666bc3..786d4f96b 100644 --- a/regress/sql-mm-general_expected +++ b/regress/sql-mm-general_expected @@ -11,3 +11,4 @@ t 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)