PostGIS  2.1.10dev-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 641 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().

642 {
643  gbox->xmin = next_float_down(gbox->xmin);
644  gbox->xmax = next_float_up(gbox->xmax);
645 
646  gbox->ymin = next_float_down(gbox->ymin);
647  gbox->ymax = next_float_up(gbox->ymax);
648 
649  if ( FLAGS_GET_M(gbox->flags) )
650  {
651  gbox->mmin = next_float_down(gbox->mmin);
652  gbox->mmax = next_float_up(gbox->mmax);
653  }
654 
655  if ( FLAGS_GET_Z(gbox->flags) )
656  {
657  gbox->zmin = next_float_down(gbox->zmin);
658  gbox->zmax = next_float_up(gbox->zmax);
659  }
660 }
double xmax
Definition: liblwgeom.h:249
float next_float_down(double d)
Definition: lwgeom_api.c:129
float next_float_up(double d)
Definition: lwgeom_api.c:145
double zmax
Definition: liblwgeom.h:253
double ymin
Definition: liblwgeom.h:250
double xmin
Definition: liblwgeom.h:248
double ymax
Definition: liblwgeom.h:251
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
uint8_t flags
Definition: liblwgeom.h:247
double mmin
Definition: liblwgeom.h:254
double zmin
Definition: liblwgeom.h:252
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:107
double mmax
Definition: liblwgeom.h:255

Here is the call graph for this function:

Here is the caller graph for this function: