PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ gbox_same_2d_float()

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 194 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().

195 {
196  if ((g1->xmax == g2->xmax || next_float_up(g1->xmax) == next_float_up(g2->xmax)) &&
197  (g1->ymax == g2->ymax || next_float_up(g1->ymax) == next_float_up(g2->ymax)) &&
198  (g1->xmin == g2->xmin || next_float_down(g1->xmin) == next_float_down(g1->xmin)) &&
199  (g1->ymin == g2->ymin || next_float_down(g2->ymin) == next_float_down(g2->ymin)))
200  return LW_TRUE;
201  return LW_FALSE;
202 }
double xmax
Definition: liblwgeom.h:295
float next_float_down(double d)
Definition: lwgeom_api.c:52
float next_float_up(double d)
Definition: lwgeom_api.c:68
double ymin
Definition: liblwgeom.h:296
double xmin
Definition: liblwgeom.h:294
#define LW_FALSE
Definition: liblwgeom.h:76
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
double ymax
Definition: liblwgeom.h:297
Here is the call graph for this function:
Here is the caller graph for this function: