[postgis-commits] svn - r3436 - trunk/liblwgeom
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Wed Dec 17 11:37:33 PST 2008
Author: mcayland
Date: 2008-12-17 11:37:32 -0800 (Wed, 17 Dec 2008)
New Revision: 3436
Modified:
trunk/liblwgeom/lwgunparse.c
Log:
#HISTORY: Really fix what was broken in r3431/3432. See the notes there for the full detail.
Modified: trunk/liblwgeom/lwgunparse.c
===================================================================
--- trunk/liblwgeom/lwgunparse.c 2008-12-17 18:20:18 UTC (rev 3435)
+++ trunk/liblwgeom/lwgunparse.c 2008-12-17 19:37:32 UTC (rev 3436)
@@ -415,40 +415,41 @@
return output_wkt(geom,suppress);
}
-/* special case for compound to suppress linestring but not circularstring */
+/* Special case for compound curves: suppress the LINESTRING prefix from a curve if it appears as
+ a component of a COMPOUNDCURVE, but not CIRCULARSTRING */
uchar *output_compound(uchar* geom, int suppress) {
unsigned type;
LWDEBUG(2, "output_compound called.");
- type=*geom++;
+ type=*geom;
switch(TYPE_GETTYPE(type))
{
case LINETYPE:
- geom = output_collection(geom,output_point,0);
+ geom = output_wkt(geom,2);
break;
case CURVETYPE:
- write_str("CIRCULARSTRING");
- geom = output_curve_collection(geom,output_point,1);
+ geom = output_wkt(geom,1);
break;
}
return geom;
}
+/* Special case for multisurfaces: suppress the POLYGON prefix from a surface if it appears as
+ a component of a MULTISURFACE, but not CURVEPOLYGON */
uchar *output_multisurface(uchar* geom, int suppress) {
unsigned type;
LWDEBUG(2, "output_multisurface called.");
- type=*geom++;
+ type=*geom;
switch(TYPE_GETTYPE(type))
{
case POLYGONTYPE:
- geom = output_collection(geom, output_polygon_collection,0);
+ geom = output_wkt(geom,2);
break;
case CURVEPOLYTYPE:
- write_str("CURVEPOLYGON");
- geom = output_collection(geom, output_compound,1);
+ geom = output_wkt(geom,1);
break;
}
return geom;
More information about the postgis-commits
mailing list