PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gbox_same()

int gbox_same ( const GBOX g1,
const GBOX g2 
)

Check if 2 given Gbox are the same.

Definition at line 176 of file g_box.c.

References GBOX::flags, FLAGS_GET_M, FLAGS_GET_Z, FLAGS_GET_ZM, gbox_same_2d(), LW_FALSE, LW_TRUE, GBOX::mmax, GBOX::mmin, GBOX::zmax, and GBOX::zmin.

Referenced by lwgeom_same(), test_gserialized_peek_gbox_p_gets_correct_box(), test_lwgeom_from_gserialized(), and test_lwgeom_voronoi_diagram_custom_envelope().

177 {
178  if (FLAGS_GET_ZM(g1->flags) != FLAGS_GET_ZM(g2->flags))
179  return LW_FALSE;
180 
181  if (!gbox_same_2d(g1, g2)) return LW_FALSE;
182 
183  if (FLAGS_GET_Z(g1->flags) && (g1->zmin != g2->zmin || g1->zmax != g2->zmax))
184  return LW_FALSE;
185  if (FLAGS_GET_M(g1->flags) && (g1->mmin != g2->mmin || g1->mmax != g2->mmax))
186  return LW_FALSE;
187 
188  return LW_TRUE;
189 }
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:152
double zmax
Definition: liblwgeom.h:296
#define LW_FALSE
Definition: liblwgeom.h:76
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
int gbox_same_2d(const GBOX *g1, const GBOX *g2)
Check if 2 given GBOX are the same in x and y.
Definition: g_box.c:191
uint8_t flags
Definition: liblwgeom.h:290
double mmin
Definition: liblwgeom.h:297
double zmin
Definition: liblwgeom.h:295
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
double mmax
Definition: liblwgeom.h:298
Here is the call graph for this function:
Here is the caller graph for this function: