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

◆ gbox_float_round()

void gbox_float_round ( GBOX gbox)

Round given GBOX to float boundaries.

This turns a GBOX into the version it would become after a serialize/deserialize round trip.

Definition at line 786 of file gbox.c.

787{
788 gbox->xmin = next_float_down(gbox->xmin);
789 gbox->xmax = next_float_up(gbox->xmax);
790
791 gbox->ymin = next_float_down(gbox->ymin);
792 gbox->ymax = next_float_up(gbox->ymax);
793
794 if ( FLAGS_GET_M(gbox->flags) )
795 {
796 gbox->mmin = next_float_down(gbox->mmin);
797 gbox->mmax = next_float_up(gbox->mmax);
798 }
799
800 if ( FLAGS_GET_Z(gbox->flags) )
801 {
802 gbox->zmin = next_float_down(gbox->zmin);
803 gbox->zmax = next_float_up(gbox->zmax);
804 }
805}
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:166
float next_float_up(double d)
Definition lwgeom_api.c:74
float next_float_down(double d)
Definition lwgeom_api.c:53
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 mmax
Definition liblwgeom.h:361
double ymin
Definition liblwgeom.h:356
double xmin
Definition liblwgeom.h:354
double mmin
Definition liblwgeom.h:360
lwflags_t flags
Definition liblwgeom.h:353

References GBOX::flags, FLAGS_GET_M, FLAGS_GET_Z, GBOX::mmax, GBOX::mmin, next_float_down(), next_float_up(), GBOX::xmax, GBOX::xmin, GBOX::ymax, GBOX::ymin, GBOX::zmax, and GBOX::zmin.

Referenced by gserialized1_get_gbox_p(), gserialized1_peek_gbox_p(), gserialized1_set_gbox(), gserialized2_get_gbox_p(), gserialized2_peek_gbox_p(), gserialized2_set_gbox(), test_gserialized1_peek_gbox_p_gets_correct_box(), test_gserialized2_peek_gbox_p_gets_correct_box(), test_lwgeom_from_gserialized(), and test_lwgeom_from_gserialized2().

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