PostGIS  2.2.7dev-r@@SVN_REVISION@@
int gbox_same_2d_float ( const GBOX g1,
const GBOX g2 

Check if two given GBOX are the same in x and y, or would round to the same GBOX in x and if serialized in GSERIALIZED.

Definition at line 164 of file g_box.c.

References LW_FALSE, LW_TRUE, next_float_down(), next_float_up(), GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

Referenced by ST_Equals(), and test_gbox_same_2d().

165 {
166  if ((g1->xmax == g2->xmax || next_float_up(g1->xmax) == next_float_up(g2->xmax)) &&
167  (g1->ymax == g2->ymax || next_float_up(g1->ymax) == next_float_up(g2->ymax)) &&
168  (g1->xmin == g2->xmin || next_float_down(g1->xmin) == next_float_down(g1->xmin)) &&
169  (g1->ymin == g2->ymin || next_float_down(g2->ymin) == next_float_down(g2->ymin)))
170  return LW_TRUE;
171  return LW_FALSE;
172 }
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 ymin
Definition: liblwgeom.h:278
double xmin
Definition: liblwgeom.h:276
#define LW_FALSE
Definition: liblwgeom.h:62
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
double ymax
Definition: liblwgeom.h:279

Here is the call graph for this function:

Here is the caller graph for this function: