]> granicus.if.org Git - postgis/commitdiff
Back out removal of "peek" mode for gbox reading...
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 11 Jun 2019 17:27:46 +0000 (17:27 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 11 Jun 2019 17:27:46 +0000 (17:27 +0000)
Seems like it is more widely used and sufficiently different
from "read" mode that it needs to stay for now

git-svn-id: http://svn.osgeo.org/postgis/trunk@17494 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_serialized.c
postgis/lwgeom_out_mvt.c

index d3e2e3dff086556cc6a6a0aa224aadfcd517d5f5..2a525620d5e544df366d26de0170d29e1b94d7f8 100644 (file)
@@ -465,12 +465,7 @@ int gserialized_read_gbox_p(const GSERIALIZED *g, GBOX *gbox)
                }
                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;
 }
 
 /*
index c715855515f00df7f7333b355eca49502c855a55..6e992b00e92792f61cbe9810cf4f1edfd621f8a3 100644 (file)
@@ -89,7 +89,8 @@ Datum ST_AsMVTGeom(PG_FUNCTION_ARGS)
        {
                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;