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

◆ test_gserialized_get_gbox_geocentric()

static void test_gserialized_get_gbox_geocentric ( void  )
static

Definition at line 295 of file cu_geodetic.c.

296{
297 LWGEOM *lwg;
298 GBOX gbox, gbox_slow;
299 int i;
300
301 for ( i = 0; i < gbox_data_length; i++ )
302 {
303#if 0
304// if ( i != 0 ) continue; /* skip our bad case */
305 printf("\n\n------------\n");
306 printf("%s\n", gbox_data[i]);
307#endif
309 FLAGS_SET_GEODETIC(lwg->flags, 1);
311 lwgeom_calculate_gbox(lwg, &gbox);
313 lwgeom_calculate_gbox(lwg, &gbox_slow);
315 lwgeom_free(lwg);
316#if 0
317 printf("\nCALC: %s\n", gbox_to_string(&gbox));
318 printf("GOOD: %s\n", gbox_to_string(&gbox_slow));
319 printf("line %d: diff %.9g\n", i, fabs(gbox.xmin - gbox_slow.xmin)+fabs(gbox.ymin - gbox_slow.ymin)+fabs(gbox.zmin - gbox_slow.zmin));
320 printf("------------\n");
321#endif
322 CU_ASSERT_DOUBLE_EQUAL(gbox.xmin, gbox_slow.xmin, 0.00000001);
323 CU_ASSERT_DOUBLE_EQUAL(gbox.ymin, gbox_slow.ymin, 0.00000001);
324 CU_ASSERT_DOUBLE_EQUAL(gbox.zmin, gbox_slow.zmin, 0.00000001);
325 CU_ASSERT_DOUBLE_EQUAL(gbox.xmax, gbox_slow.xmax, 0.00000001);
326 CU_ASSERT_DOUBLE_EQUAL(gbox.ymax, gbox_slow.ymax, 0.00000001);
327 CU_ASSERT_DOUBLE_EQUAL(gbox.zmax, gbox_slow.zmax, 0.00000001);
328 }
329
330}
int gbox_data_length
char gbox_data[][512]
char * gbox_to_string(const GBOX *gbox)
Allocate a string representation of the GBOX, based on dimensionality of flags.
Definition gbox.c:404
#define LW_FALSE
Definition liblwgeom.h:94
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate bounding box of a geometry, automatically taking into account whether it is cartesian or ge...
Definition lwgeom.c:783
#define FLAGS_SET_GEODETIC(flags, value)
Definition liblwgeom.h:175
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:93
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940
int gbox_geocentric_slow
For testing geodetic bounding box, we have a magic global variable.
Definition lwgeodetic.c:36
double ymax
Definition liblwgeom.h:357
double zmax
Definition liblwgeom.h:359
double xmax
Definition liblwgeom.h:355
double zmin
Definition liblwgeom.h:358
double ymin
Definition liblwgeom.h:356
double xmin
Definition liblwgeom.h:354
lwflags_t flags
Definition liblwgeom.h:461

References LWGEOM::flags, FLAGS_SET_GEODETIC, gbox_data, gbox_data_length, gbox_geocentric_slow, gbox_to_string(), LW_FALSE, LW_PARSER_CHECK_NONE, LW_TRUE, lwgeom_calculate_gbox(), lwgeom_free(), lwgeom_from_wkt(), GBOX::xmax, GBOX::xmin, GBOX::ymax, GBOX::ymin, GBOX::zmax, and GBOX::zmin.

Referenced by geodetic_suite_setup().

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