PostGIS  2.4.9dev-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 199 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().

200 {
201  if ((g1->xmax == g2->xmax || next_float_up(g1->xmax) == next_float_up(g2->xmax)) &&
202  (g1->ymax == g2->ymax || next_float_up(g1->ymax) == next_float_up(g2->ymax)) &&
203  (g1->xmin == g2->xmin || next_float_down(g1->xmin) == next_float_down(g1->xmin)) &&
204  (g1->ymin == g2->ymin || next_float_down(g2->ymin) == next_float_down(g2->ymin)))
205  return LW_TRUE;
206  return LW_FALSE;
207 }
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 ymin
Definition: liblwgeom.h:294
double xmin
Definition: liblwgeom.h:292
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
double ymax
Definition: liblwgeom.h:295
Here is the call graph for this function:
Here is the caller graph for this function: