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

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Mon Dec 15 02:35:03 PST 2008


Author: mcayland
Date: 2008-12-15 02:35:03 -0800 (Mon, 15 Dec 2008)
New Revision: 3407

Modified:
   branches/1.3/lwgeom/lwgeom_functions_basic.c
Log:
#HISTORY: Fix for GBT#83: "ST_Multi on curved polygon gives ERROR: Unknown geometry type: 0". On reflection, ST_Multi() can only operate on standard POINT, LINESTRING and POLYGON types as the only MULTI geomtypes are MULTIPOINT, MULTILINESTRING and MULTIPOLYGON. This was caused by the introduction of the curve crashing fixes in 1.3.4.


Modified: branches/1.3/lwgeom/lwgeom_functions_basic.c
===================================================================
--- branches/1.3/lwgeom/lwgeom_functions_basic.c	2008-12-15 10:30:19 UTC (rev 3406)
+++ branches/1.3/lwgeom/lwgeom_functions_basic.c	2008-12-15 10:35:03 UTC (rev 3407)
@@ -1572,8 +1572,8 @@
 	lwgeom = lwgeom_deserialize(SERIALIZED_FORM(geom));
 	type = TYPE_GETTYPE(lwgeom->type);
 
-	/* single geom, make it a multi */
-	if ( ! lwgeom_contains_subgeoms(type) )
+	/* if it's a single POINT, LINESTRING or POLYGON geom, make it a multi */
+	if ( type == POINTTYPE || type == LINETYPE || type == POLYGONTYPE )
 	{
 		type += 3;
 		SRID = lwgeom->SRID;



More information about the postgis-commits mailing list