]> granicus.if.org Git - postgis/commitdiff
Add COMPOUNDCURVE in MULTICURVE support for ST_CurveToLine (#2424)
authorSandro Santilli <strk@keybit.net>
Tue, 13 Aug 2013 06:51:12 +0000 (06:51 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 13 Aug 2013 06:51:12 +0000 (06:51 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11784 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwsegmentize.c
regress/tickets.sql
regress/tickets_expected

index 660a3867a4a2c8baac22d4f62a1e18d2f5b2216e..991cb1f6b353a55a4a58bf0585ae53f9d6b8d073 100644 (file)
@@ -352,6 +352,10 @@ lwmcurve_segmentize(LWMCURVE *mcurve, uint32_t perQuad)
                {
                        lines[i] = (LWGEOM *)lwline_construct(mcurve->srid, NULL, ptarray_clone_deep(((LWLINE *)tmp)->points));
                }
+               else if (tmp->type == COMPOUNDTYPE)
+               {
+                       lines[i] = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
+               }
                else
                {
                        lwerror("Unsupported geometry found in MultiCurve.");
index adc98a4999d85900dc73b203c7b42265ad3c4c19..03142a34e8c959b14363d1e76d6ce6bce9040bed 100644 (file)
@@ -837,5 +837,9 @@ SELECT '#2423', ST_AsText(ST_SnapToGrid(ST_CurveToLine(ST_LineToCurve(
   ST_Intersection(ST_Buffer(ST_Point(0,0),10),ST_MakeEnvelope(-10,0,10,10))
 ), 4), 1e-5));
 
+SELECT '#2424', ST_AsText(ST_SnapToGrid(ST_CurveToLine(
+  'MULTICURVE(COMPOUNDCURVE((0 0, 10 0),CIRCULARSTRING(10 0, 20 1, 30 10)))',
+2),1));
+
 -- Clean up
 DELETE FROM spatial_ref_sys;
index cc3ff0162f2b8b6bf8ae555cec4141efb1ef5b0b..5bba2e1e15b0089dff881df28c8dd27166223439 100644 (file)
@@ -249,3 +249,4 @@ ERROR:  invalid GML representation
 #2412|LINESTRING(0 0,10 0,20 0)
 #2420|LINESTRING(0 0,10 0,10 10,0 10,0 0)
 #2423|POLYGON((-10 0,-9.2388 3.82683,-7.07107 7.07107,-3.82683 9.2388,0 10,3.82683 9.2388,7.07107 7.07107,9.2388 3.82683,10 0,-10 0))
+#2424|MULTILINESTRING((0 0,10 0,24 3,30 10))