PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ lwpolygon_calculate_gbox_geodetic()

static int lwpolygon_calculate_gbox_geodetic ( const LWPOLY poly,
GBOX gbox 
)
static

Definition at line 2796 of file lwgeodetic.c.

2797 {
2798  GBOX ringbox;
2799  uint32_t i;
2800  int first = LW_TRUE;
2801  assert(poly);
2802  if ( poly->nrings == 0 )
2803  return LW_FAILURE;
2804  ringbox.flags = gbox->flags;
2805  for ( i = 0; i < poly->nrings; i++ )
2806  {
2807  if ( ptarray_calculate_gbox_geodetic(poly->rings[i], &ringbox) == LW_FAILURE )
2808  return LW_FAILURE;
2809  if ( first )
2810  {
2811  gbox_duplicate(&ringbox, gbox);
2812  first = LW_FALSE;
2813  }
2814  else
2815  {
2816  gbox_merge(&ringbox, gbox);
2817  }
2818  }
2819 
2820  /* If the box wraps a poly, push that axis to the absolute min/max as appropriate */
2821  gbox_check_poles(gbox);
2822 
2823  return LW_SUCCESS;
2824 }
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: gbox.c:257
void gbox_duplicate(const GBOX *original, GBOX *duplicate)
Copy the values of original GBOX into duplicate.
Definition: gbox.c:433
#define LW_FALSE
Definition: liblwgeom.h:109
#define LW_FAILURE
Definition: liblwgeom.h:111
#define LW_SUCCESS
Definition: liblwgeom.h:112
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:108
static int gbox_check_poles(GBOX *gbox)
Check to see if this geocentric gbox is wrapped around a pole.
Definition: lwgeodetic.c:316
int ptarray_calculate_gbox_geodetic(const POINTARRAY *pa, GBOX *gbox)
Calculate geodetic (x/y/z) box and add values to gbox.
Definition: lwgeodetic.c:2729
lwflags_t flags
Definition: liblwgeom.h:368
POINTARRAY ** rings
Definition: liblwgeom.h:534
uint32_t nrings
Definition: liblwgeom.h:539

References GBOX::flags, gbox_check_poles(), gbox_duplicate(), gbox_merge(), LW_FAILURE, LW_FALSE, LW_SUCCESS, LW_TRUE, LWPOLY::nrings, ptarray_calculate_gbox_geodetic(), and LWPOLY::rings.

Referenced by lwgeom_calculate_gbox_geodetic().

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