[postgis-commits] svn - r3437 - branches/1.3/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Wed Dec 17 11:43:53 PST 2008


Author: mcayland
Date: 2008-12-17 11:43:52 -0800 (Wed, 17 Dec 2008)
New Revision: 3437

Modified:
   branches/1.3/lwgeom/wktunparse.c
Log:
#HISTORY: Really fix what was broken in r3431/3432. See the notes there for the full detail.


Modified: branches/1.3/lwgeom/wktunparse.c
===================================================================
--- branches/1.3/lwgeom/wktunparse.c	2008-12-17 19:37:32 UTC (rev 3436)
+++ branches/1.3/lwgeom/wktunparse.c	2008-12-17 19:43:52 UTC (rev 3437)
@@ -237,7 +237,8 @@
 	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;
 
@@ -245,20 +246,21 @@
         lwnotice("output_compound called.");
 #endif
 
-        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_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;
 
@@ -266,15 +268,14 @@
         lwnotice("output_multisurface called.");
 #endif
 
-        type=*geom++;
+        type=*geom;
         switch(TYPE_GETTYPE(type))
         {
                 case POLYGONTYPE:
-                        geom = output_collection(geom, output_collection_2,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