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

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Fri Nov 7 05:54:22 PST 2008


Author: mcayland
Date: 2008-11-07 05:54:21 -0800 (Fri, 07 Nov 2008)
New Revision: 3274

Modified:
   branches/1.3/lwgeom/lwgeom_transform.c
Log:
After a quick sanity grep, I noticed that ST_Transform() was also susceptible to crashing on curve types in the same way as the previous two fixes. Hence I'm committing a fix now before Regina finds it and logs another bug report :)


Modified: branches/1.3/lwgeom/lwgeom_transform.c
===================================================================
--- branches/1.3/lwgeom/lwgeom_transform.c	2008-11-07 13:45:42 UTC (rev 3273)
+++ branches/1.3/lwgeom/lwgeom_transform.c	2008-11-07 13:54:21 UTC (rev 3274)
@@ -750,6 +750,7 @@
 		LWLINE *line=NULL;
 		LWPOINT *point=NULL;
 		LWPOLY *poly=NULL;
+		LWCURVE *curve=NULL;
 		POINT4D p;
 		uchar *subgeom=NULL;
 
@@ -795,6 +796,20 @@
 			continue;
 		}
 
+		curve = lwgeom_getcurve_inspected(inspected, j);
+		if (curve != NULL)
+		{
+			POINTARRAY *pts = curve->points;
+			for (i=0; i<pts->npoints; i++)
+			{
+				getPoint4d_p(pts, i, &p);
+				transform_point(&p, inpj, outpj);
+				setPoint4d(pts, i, &p);
+			}
+			lwgeom_release((LWGEOM *)curve);
+			continue;
+		}
+
 		subgeom = lwgeom_getsubgeometry_inspected(inspected, j);
 		if ( subgeom != NULL )
 		{



More information about the postgis-commits mailing list