PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ptarray_calculate_gbox_cartesian_2d()

static void ptarray_calculate_gbox_cartesian_2d ( const POINTARRAY pa,
GBOX gbox 
)
static

Definition at line 537 of file gbox.c.

538 {
539  const POINT2D *p = getPoint2d_cp(pa, 0);
540 
541  gbox->xmax = gbox->xmin = p->x;
542  gbox->ymax = gbox->ymin = p->y;
543 
544  for (uint32_t i = 1; i < pa->npoints; i++)
545  {
546  p = getPoint2d_cp(pa, i);
547  gbox->xmin = FP_MIN(gbox->xmin, p->x);
548  gbox->xmax = FP_MAX(gbox->xmax, p->x);
549  gbox->ymin = FP_MIN(gbox->ymin, p->y);
550  gbox->ymax = FP_MAX(gbox->ymax, p->y);
551  }
552 }
#define FP_MAX(A, B)
#define FP_MIN(A, B)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:91
double ymax
Definition: liblwgeom.h:343
double xmax
Definition: liblwgeom.h:341
double ymin
Definition: liblwgeom.h:342
double xmin
Definition: liblwgeom.h:340
double y
Definition: liblwgeom.h:376
double x
Definition: liblwgeom.h:376
uint32_t npoints
Definition: liblwgeom.h:413

References FP_MAX, FP_MIN, getPoint2d_cp(), POINTARRAY::npoints, POINT2D::x, GBOX::xmax, GBOX::xmin, POINT2D::y, GBOX::ymax, and GBOX::ymin.

Referenced by ptarray_calculate_gbox_cartesian().

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