PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ mbc_test()

static void mbc_test ( LWGEOM g)
static

Definition at line 16 of file cu_minimum_bounding_circle.c.

17 {
19  CU_ASSERT_TRUE(result != NULL);
20 
22 
23  POINT2D p;
24  POINT4D p4;
25  while (lwpointiterator_next(it, &p4))
26  {
27  p.x = p4.x;
28  p.y = p4.y;
29 
30  /* We need to store the distance in a variable before the assert so that
31  * it is rounded from its 80-bit representation (on x86) down to 64 bits.
32  * */
33  volatile double d = distance2d_pt_pt(result->center, &p);
34 
35  CU_ASSERT_TRUE(d <= result->radius);
36  }
37 
40 }
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
Definition: measures.c:2314
LWPOINTITERATOR * lwpointiterator_create(const LWGEOM *g)
Create a new LWPOINTITERATOR over supplied LWGEOM*.
Definition: lwiterator.c:244
int lwpointiterator_next(LWPOINTITERATOR *s, POINT4D *p)
Attempts to assign the next point in the iterator to p, and advances the iterator to the next point.
Definition: lwiterator.c:212
void lwpointiterator_destroy(LWPOINTITERATOR *s)
Free all memory associated with the iterator.
Definition: lwiterator.c:269
LWBOUNDINGCIRCLE * lwgeom_calculate_mbc(const LWGEOM *g)
void lwboundingcircle_destroy(LWBOUNDINGCIRCLE *c)
POINT2D * center
Definition: liblwgeom.h:1650
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:355
double y
Definition: liblwgeom.h:355

References LWBOUNDINGCIRCLE::center, distance2d_pt_pt(), lwboundingcircle_destroy(), lwgeom_calculate_mbc(), lwpointiterator_create(), lwpointiterator_destroy(), lwpointiterator_next(), POINT2D::x, POINT4D::x, POINT2D::y, and POINT4D::y.

Referenced by basic_test().

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