PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ptarray_calculate_gbox_cartesian_2d()

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

Definition at line 549 of file gbox.c.

550{
551 const POINT2D *p = getPoint2d_cp(pa, 0);
552
553 gbox->xmax = gbox->xmin = p->x;
554 gbox->ymax = gbox->ymin = p->y;
555
556 for (uint32_t i = 1; i < pa->npoints; i++)
557 {
558 p = getPoint2d_cp(pa, i);
559 gbox->xmin = FP_MIN(gbox->xmin, p->x);
560 gbox->xmax = FP_MAX(gbox->xmax, p->x);
561 gbox->ymin = FP_MIN(gbox->ymin, p->y);
562 gbox->ymax = FP_MAX(gbox->ymax, p->y);
563 }
564}
#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:97
double ymax
Definition liblwgeom.h:357
double xmax
Definition liblwgeom.h:355
double ymin
Definition liblwgeom.h:356
double xmin
Definition liblwgeom.h:354
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390
uint32_t npoints
Definition liblwgeom.h:427

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: