Compute a box for geom and all sub-geometries, if not already computed.
Definition at line 660 of file lwgeom.c.
References LWGEOM::bbox, LWGEOM::flags, FLAGS_SET_BBOX, gbox_clone(), gbox_new(), LWCOLLECTION::geoms, lwgeom_calculate_gbox(), lwgeom_is_collection(), lwgeom_is_empty(), and LWCOLLECTION::ngeoms.
Referenced by geography_distance_knn(), and geography_distance_uncached().
666 if ( ! ( gbox || lwgeom->
bbox ) )
671 else if ( gbox && ! lwgeom->
bbox )
681 for ( i = 0; i < lwcol->
ngeoms; i++ )
GBOX * gbox_new(uint8_t flags)
Create a new gbox with the dimensionality indicated by the flags.
void lwgeom_add_bbox_deep(LWGEOM *lwgeom, GBOX *gbox)
Compute a box for geom and all sub-geometries, if not already computed.
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
#define FLAGS_SET_BBOX(flags, value)
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate the gbox for this goemetry, a cartesian box or geodetic box, depending on how it is flagged...
GBOX * gbox_clone(const GBOX *gbox)