PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ _lwt_EdgeRingGetBbox()

static GBOX* _lwt_EdgeRingGetBbox ( LWT_EDGERING ring)
static

Definition at line 6416 of file lwgeom_topo.c.

6417 {
6418  int i;
6419 
6420  if ( ! ring->env )
6421  {
6422  LWDEBUGF(2, "Computing GBOX for ring %p", ring);
6423  for (i=0; i<ring->size; ++i)
6424  {
6425  LWT_EDGERING_ELEM *elem = ring->elems[i];
6426  LWLINE *g = elem->edge->geom;
6427  const GBOX *newbox = lwgeom_get_bbox(lwline_as_lwgeom(g));
6428  if ( ! i ) ring->env = gbox_clone( newbox );
6429  else gbox_merge( newbox, ring->env );
6430  }
6431  }
6432 
6433  return ring->env;
6434 }
int gbox_merge(const GBOX *new_box, GBOX *merge_box)
Update the merged GBOX to be large enough to include itself and the new box.
Definition: g_box.c:264
GBOX * gbox_clone(const GBOX *gbox)
Definition: g_box.c:52
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:330
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
Definition: lwgeom.c:734
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
LWT_ISO_EDGE * edge
Definition: lwgeom_topo.c:5979
LWT_EDGERING_ELEM ** elems
Definition: lwgeom_topo.c:5989
LWLINE * geom

References LWT_EDGERING_ELEM_T::edge, LWT_EDGERING_T::elems, LWT_EDGERING_T::env, gbox_clone(), gbox_merge(), LWT_ISO_EDGE::geom, LWDEBUGF, lwgeom_get_bbox(), lwline_as_lwgeom(), and LWT_EDGERING_T::size.

Referenced by _lwt_FindFaceContainingRing(), and _lwt_RegisterFaceOnEdgeSide().

Here is the call graph for this function:
Here is the caller graph for this function: