PostGIS 3.0.6dev-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 774 of file gbox.c.

775{
776 gbox->xmin = next_float_down(gbox->xmin);
777 gbox->xmax = next_float_up(gbox->xmax);
778
779 gbox->ymin = next_float_down(gbox->ymin);
780 gbox->ymax = next_float_up(gbox->ymax);
781
782 if ( FLAGS_GET_M(gbox->flags) )
783 {
784 gbox->mmin = next_float_down(gbox->mmin);
785 gbox->mmax = next_float_up(gbox->mmax);
786 }
787
788 if ( FLAGS_GET_Z(gbox->flags) )
789 {
790 gbox->zmin = next_float_down(gbox->zmin);
791 gbox->zmax = next_float_up(gbox->zmax);
792 }
793}
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:179
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:180
float next_float_up(double d)
Definition lwgeom_api.c:75
float next_float_down(double d)
Definition lwgeom_api.c:54
double ymax
Definition liblwgeom.h:343
double zmax
Definition liblwgeom.h:345
double xmax
Definition liblwgeom.h:341
double zmin
Definition liblwgeom.h:344
double mmax
Definition liblwgeom.h:347
double ymin
Definition liblwgeom.h:342
double xmin
Definition liblwgeom.h:340
double mmin
Definition liblwgeom.h:346
lwflags_t flags
Definition liblwgeom.h:339

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: