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

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Sun Mar 8 14:46:25 PDT 2009


Author: pramsey
Date: 2009-03-08 14:46:25 -0700 (Sun, 08 Mar 2009)
New Revision: 3810

Modified:
   branches/1.3/lwgeom/lwgeom_api.c
Log:
Fix goof in box2d computation.


Modified: branches/1.3/lwgeom/lwgeom_api.c
===================================================================
--- branches/1.3/lwgeom/lwgeom_api.c	2009-03-08 21:41:23 UTC (rev 3809)
+++ branches/1.3/lwgeom/lwgeom_api.c	2009-03-08 21:46:25 UTC (rev 3810)
@@ -1720,11 +1720,7 @@
 		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);
@@ -1739,7 +1735,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