extern int compute_serialized_box3d_p(uint8_t *serialized_form, BOX3D *box);
-/*
- * Evaluate with an heuristic if the provided PG_LWGEOM is worth
- * caching a bbox
- */
-char is_worth_caching_serialized_bbox(const uint8_t *);
-char is_worth_caching_lwgeom_bbox(const LWGEOM *);
-
-
/*
* This function computes the size in bytes
* of the serialized geometries.
POSTGIS_DEBUGF(4, "GEOS2POSTGIS: GEOS2LWGEOM returned a %s", lwgeom_summary(lwgeom, 0));
- if ( is_worth_caching_lwgeom_bbox(lwgeom) )
+ if ( lwgeom_needs_bbox(lwgeom) == LW_TRUE )
{
lwgeom_add_bbox(lwgeom);
}
PG_RETURN_POINTER(result);
}
-char
-is_worth_caching_serialized_bbox(const uint8_t *in)
-{
-#if ! POSTGIS_AUTOCACHE_BBOX
- return false;
-#endif
- if ( TYPE_GETTYPE((uint8_t)in[0]) == POINTTYPE ) return false;
- return true;
-}
-
-char
-is_worth_caching_lwgeom_bbox(const LWGEOM *in)
-{
-#if ! POSTGIS_AUTOCACHE_BBOX
- return false;
-#endif
- if ( TYPE_GETTYPE(in->type) == POINTTYPE ) return false;
- return true;
-}
-
/* removes a bbox from a geometry */
PG_FUNCTION_INFO_V1(LWGEOM_dropBBOX);
Datum LWGEOM_dropBBOX(PG_FUNCTION_ARGS)