PostGIS  2.2.7dev-r@@SVN_REVISION@@
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 682 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(), and test_lwgeom_from_gserialized().

683 {
684  gbox->xmin = next_float_down(gbox->xmin);
685  gbox->xmax = next_float_up(gbox->xmax);
686 
687  gbox->ymin = next_float_down(gbox->ymin);
688  gbox->ymax = next_float_up(gbox->ymax);
689 
690  if ( FLAGS_GET_M(gbox->flags) )
691  {
692  gbox->mmin = next_float_down(gbox->mmin);
693  gbox->mmax = next_float_up(gbox->mmax);
694  }
695 
696  if ( FLAGS_GET_Z(gbox->flags) )
697  {
698  gbox->zmin = next_float_down(gbox->zmin);
699  gbox->zmax = next_float_up(gbox->zmax);
700  }
701 }
double xmax
Definition: liblwgeom.h:277
float next_float_down(double d)
Definition: lwgeom_api.c:143
float next_float_up(double d)
Definition: lwgeom_api.c:159
double zmax
Definition: liblwgeom.h:281
double ymin
Definition: liblwgeom.h:278
double xmin
Definition: liblwgeom.h:276
double ymax
Definition: liblwgeom.h:279
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
uint8_t flags
Definition: liblwgeom.h:275
double mmin
Definition: liblwgeom.h:282
double zmin
Definition: liblwgeom.h:280
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
double mmax
Definition: liblwgeom.h:283

Here is the call graph for this function:

Here is the caller graph for this function: