PostGIS_DropBBox
Name
PostGIS_DropBBox — Drop the bounding box cache from the geometry.
Synopsis
geometry
PostGIS_DropBBox
(
geometry
geomA
)
;
Description
Drop the bounding box cache from the geometry. This reduces geometry size, but makes bounding-box based queries slower. It is also used to drop a corrupt bounding box. A tale-tell sign of a corrupt cached bounding box is when your ST_Intersects and other relation queries leave out geometries that rightfully should return true.
Examples
--This example drops bounding boxes where the cached box is not correct --The force to ST_AsBinary before applying Box2D forces a recalculation of the box, and Box2D applied to the table geometry always -- returns the cached bounding box. UPDATE sometable SET the_geom = PostGIS_DropBBox(the_geom) WHERE Not (Box2D(ST_AsBinary(the_geom)) = Box2D(the_geom)); UPDATE sometable SET the_geom = PostGIS_AddBBox(the_geom) WHERE Not PostGIS_HasBBOX(the_geom);