PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ 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 717 of file g_box.c.

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 gserialized_get_gbox_p(), gserialized_peek_gbox_p(), test_gserialized_peek_gbox_p_gets_correct_box(), and test_lwgeom_from_gserialized().

718 {
719  gbox->xmin = next_float_down(gbox->xmin);
720  gbox->xmax = next_float_up(gbox->xmax);
721 
722  gbox->ymin = next_float_down(gbox->ymin);
723  gbox->ymax = next_float_up(gbox->ymax);
724 
725  if ( FLAGS_GET_M(gbox->flags) )
726  {
727  gbox->mmin = next_float_down(gbox->mmin);
728  gbox->mmax = next_float_up(gbox->mmax);
729  }
730 
731  if ( FLAGS_GET_Z(gbox->flags) )
732  {
733  gbox->zmin = next_float_down(gbox->zmin);
734  gbox->zmax = next_float_up(gbox->zmax);
735  }
736 }
double xmax
Definition: liblwgeom.h:293
float next_float_down(double d)
Definition: lwgeom_api.c:51
float next_float_up(double d)
Definition: lwgeom_api.c:72
double zmax
Definition: liblwgeom.h:297
double ymin
Definition: liblwgeom.h:294
double xmin
Definition: liblwgeom.h:292
double ymax
Definition: liblwgeom.h:295
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
uint8_t flags
Definition: liblwgeom.h:291
double mmin
Definition: liblwgeom.h:298
double zmin
Definition: liblwgeom.h:296
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
double mmax
Definition: liblwgeom.h:299
Here is the call graph for this function:
Here is the caller graph for this function: