From: Paul Ramsey Date: Fri, 31 Oct 2014 16:20:30 +0000 (+0000) Subject: #2938, fix to include around curvepolygon rings (eroualt) X-Git-Tag: 2.2.0rc1~740 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b0e91a20146ac23c956563341e56dba8cdf848a;p=postgis #2938, fix to include around curvepolygon rings (eroualt) git-svn-id: http://svn.osgeo.org/postgis/trunk@13116 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/cunit/cu_out_gml.c b/liblwgeom/cunit/cu_out_gml.c index 56665679b..c37c46ba8 100644 --- a/liblwgeom/cunit/cu_out_gml.c +++ b/liblwgeom/cunit/cu_out_gml.c @@ -559,10 +559,11 @@ static void out_gml_test_geoms(void) /* GML3 - CurvePolygon */ do_gml3_test( "CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0))", - "-2 0 -1 -1 0 0 1 -1 2 0 0 2 -2 0-1 0 0 0.5 1 0 0 1 -1 0", + "-2 0 -1 -1 0 0 1 -1 2 0 0 2 -2 0-1 0 0 0.5 1 0 0 1 -1 0", NULL, 1, 0 ); do_gml3_test( - "CURVEPOLYGON(COMPOUNDCURVE((763650.600000001 189057.100000001,7636.35 189045.199999999, 763650.548999999 189057.844000001,763650.600000001 189057.100000001)))","763650.6 189057.1 7636.35 189045.2 763650.549 189057.844 763650.6 189057.1", + "CURVEPOLYGON(COMPOUNDCURVE((763650.600000001 189057.100000001,7636.35 189045.199999999, 763650.548999999 189057.844000001,763650.600000001 189057.100000001)))", + "763650.6 189057.1 7636.35 189045.2 763650.549 189057.844 763650.6 189057.1", NULL, 7, 0 ); /* GML2 - MultiCurve */ @@ -584,7 +585,7 @@ static void out_gml_test_geoms(void) /* GML3 - MultiSurface */ do_gml3_test( "MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(-2 0,-1 -1,0 0,1 -1,2 0,0 2,-2 0),(-1 0,0 0.5,1 0,0 1,-1 0)),((7 8,10 10,6 14,4 11,7 8)))", - "-2 0 -1 -1 0 0 1 -1 2 0 0 2 -2 0-1 0 0 0.5 1 0 0 1 -1 07 8 10 10 6 14 4 11 7 8", + "-2 0 -1 -1 0 0 1 -1 2 0 0 2 -2 0-1 0 0 0.5 1 0 0 1 -1 07 8 10 10 6 14 4 11 7 8", NULL, 1, 0 ); /* GML2 - PolyhedralSurface */ diff --git a/liblwgeom/lwout_gml.c b/liblwgeom/lwout_gml.c index cfd35b88c..7304e83ad 100644 --- a/liblwgeom/lwout_gml.c +++ b/liblwgeom/lwout_gml.c @@ -1229,11 +1229,13 @@ static size_t asgml3_curvepoly_size(const LWCURVEPOLY* poly, const char *srs, in } else if( subgeom->type == CIRCSTRINGTYPE ) { + size += sizeof("") + 2 * prefixlen; size += sizeof("") + 2 * prefixlen; size += asgml3_circstring_size((LWCIRCSTRING*)subgeom, srs, precision, opts, prefix, id); } else if( subgeom->type == COMPOUNDTYPE ) { + size += sizeof("") + 2 * prefixlen; size += sizeof("") + 2 * prefixlen; size += asgml3_compound_size( (LWCOMPOUND*)subgeom, srs, precision, opts, prefix, id ); } @@ -1291,15 +1293,19 @@ static size_t asgml3_curvepoly_buf(const LWCURVEPOLY* poly, const char *srs, cha } else if( subgeom->type == CIRCSTRINGTYPE ) { + ptr += sprintf( ptr, "<%sRing>", prefix ); ptr += sprintf( ptr, "<%scurveMember>", prefix ); ptr += asgml3_circstring_buf( (LWCIRCSTRING*)subgeom, srs, ptr, precision, opts, prefix, id ); ptr += sprintf( ptr, "", prefix ); + ptr += sprintf( ptr, "", prefix ); } else if( subgeom->type == COMPOUNDTYPE ) { + ptr += sprintf( ptr, "<%sRing>", prefix ); ptr += sprintf( ptr, "<%scurveMember>", prefix ); ptr += asgml3_compound_buf( (LWCOMPOUND*)subgeom, srs, ptr, precision, opts, prefix, id ); ptr += sprintf( ptr, "", prefix ); + ptr += sprintf( ptr, "", prefix ); } if( i == 0 )