[postgis-tickets] r17494 - Back out removal of "peek" mode for gbox reading...

Paul Ramsey pramsey at cleverelephant.ca
Tue Jun 11 10:27:46 PDT 2019


Author: pramsey
Date: 2019-06-11 10:27:46 -0700 (Tue, 11 Jun 2019)
New Revision: 17494

Modified:
   trunk/liblwgeom/g_serialized.c
   trunk/postgis/lwgeom_out_mvt.c
Log:
Back out removal of "peek" mode for gbox reading...
Seems like it is more widely used and sufficiently different
from "read" mode that it needs to stay for now


Modified: trunk/liblwgeom/g_serialized.c
===================================================================
--- trunk/liblwgeom/g_serialized.c	2019-06-11 16:30:53 UTC (rev 17493)
+++ trunk/liblwgeom/g_serialized.c	2019-06-11 17:27:46 UTC (rev 17494)
@@ -465,12 +465,7 @@
 		}
 		return LW_SUCCESS;
 	}
-	else
-	{
-		/* Read directly off coordinates for  */
-		/* simple (point, 2-point line) cases */
-		return gserialized_peek_gbox_p(g, gbox);
-	}
+	return LW_FAILURE;
 }
 
 /*

Modified: trunk/postgis/lwgeom_out_mvt.c
===================================================================
--- trunk/postgis/lwgeom_out_mvt.c	2019-06-11 16:30:53 UTC (rev 17493)
+++ trunk/postgis/lwgeom_out_mvt.c	2019-06-11 17:27:46 UTC (rev 17494)
@@ -89,7 +89,8 @@
 	{
 		GBOX gserialized_box;
 		/* We only apply the optimization if the bounding box is available */
-		if (gserialized_read_gbox_p(geom_in, &gserialized_box) == LW_SUCCESS)
+		if ((gserialized_read_gbox_p(geom_in, &gserialized_box) == LW_SUCCESS) ||
+		    (gserialized_peek_gbox_p(geom_in, &gserialized_box) == LW_SUCCESS))
 		{
 			/* Shortcut to drop geometries smaller than the resolution */
 			double geom_width = gserialized_box.xmax - gserialized_box.xmin;



More information about the postgis-tickets mailing list