[postgis-commits] svn - r3809 - trunk/liblwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Sun Mar 8 14:41:24 PDT 2009


Author: pramsey
Date: 2009-03-08 14:41:23 -0700 (Sun, 08 Mar 2009)
New Revision: 3809

Modified:
   trunk/liblwgeom/lwgeom_api.c
Log:
Fix goof in box2d computation.


Modified: trunk/liblwgeom/lwgeom_api.c
===================================================================
--- trunk/liblwgeom/lwgeom_api.c	2009-03-08 21:17:03 UTC (rev 3808)
+++ trunk/liblwgeom/lwgeom_api.c	2009-03-08 21:41:23 UTC (rev 3809)
@@ -1666,11 +1666,6 @@
 		loc +=4; /* Move past the SRID */
 	}
 
-	nelems = lw_get_uint32(loc);
-
-	/* No elements? This is an EMPTY geometry. */
-	if ( nelems == 0 ) return NULL;
-
 	if (type == POINTTYPE)
 	{
 		LWPOINT *pt = lwpoint_deserialize(srl);
@@ -1685,7 +1680,14 @@
 		return result;
 	}
 
-	else if (type == LINETYPE)
+	/* 
+	** For items that have elements (everything except points), 
+	** nelems == 0 => EMPTY geometry
+	*/
+	nelems = lw_get_uint32(loc);
+	if ( nelems == 0 ) return NULL;
+
+ 	if (type == LINETYPE)
 	{
 		LWLINE *line = lwline_deserialize(srl);
 		result = lwline_compute_box3d(line);



More information about the postgis-commits mailing list