From b4cb77f15acfa509dfb7288ef477ee2c4fe0be00 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 13 Aug 2013 06:51:12 +0000 Subject: [PATCH] Add COMPOUNDCURVE in MULTICURVE support for ST_CurveToLine (#2424) git-svn-id: http://svn.osgeo.org/postgis/trunk@11784 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwsegmentize.c | 4 ++++ regress/tickets.sql | 4 ++++ regress/tickets_expected | 1 + 3 files changed, 9 insertions(+) diff --git a/liblwgeom/lwsegmentize.c b/liblwgeom/lwsegmentize.c index 660a3867a..991cb1f6b 100644 --- a/liblwgeom/lwsegmentize.c +++ b/liblwgeom/lwsegmentize.c @@ -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."); diff --git a/regress/tickets.sql b/regress/tickets.sql index adc98a499..03142a34e 100644 --- a/regress/tickets.sql +++ b/regress/tickets.sql @@ -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; diff --git a/regress/tickets_expected b/regress/tickets_expected index cc3ff0162..5bba2e1e1 100644 --- a/regress/tickets_expected +++ b/regress/tickets_expected @@ -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)) -- 2.40.0