PostGIS  3.4.0dev-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 187 of file gbox.c.

188 {
189  if ((g1->xmax == g2->xmax || next_float_up(g1->xmax) == next_float_up(g2->xmax)) &&
190  (g1->ymax == g2->ymax || next_float_up(g1->ymax) == next_float_up(g2->ymax)) &&
191  (g1->xmin == g2->xmin || next_float_down(g1->xmin) == next_float_down(g1->xmin)) &&
192  (g1->ymin == g2->ymin || next_float_down(g2->ymin) == next_float_down(g2->ymin)))
193  return LW_TRUE;
194  return LW_FALSE;
195 }
#define LW_FALSE
Definition: liblwgeom.h:94
float next_float_up(double d)
Definition: lwgeom_api.c:75
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93
float next_float_down(double d)
Definition: lwgeom_api.c:54
double ymax
Definition: liblwgeom.h:357
double xmax
Definition: liblwgeom.h:355
double ymin
Definition: liblwgeom.h:356
double xmin
Definition: liblwgeom.h:354

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

Here is the call graph for this function:
Here is the caller graph for this function: