PostGIS  3.0.6dev-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 164 of file gbox.c.

165 {
166  if (FLAGS_GET_ZM(g1->flags) != FLAGS_GET_ZM(g2->flags))
167  return LW_FALSE;
168 
169  if (!gbox_same_2d(g1, g2)) return LW_FALSE;
170 
171  if (FLAGS_GET_Z(g1->flags) && (g1->zmin != g2->zmin || g1->zmax != g2->zmax))
172  return LW_FALSE;
173  if (FLAGS_GET_M(g1->flags) && (g1->mmin != g2->mmin || g1->mmax != g2->mmax))
174  return LW_FALSE;
175 
176  return LW_TRUE;
177 }
int gbox_same_2d(const GBOX *g1, const GBOX *g2)
Check if 2 given GBOX are the same in x and y.
Definition: gbox.c:179
#define LW_FALSE
Definition: liblwgeom.h:108
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:179
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:180
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:194
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:107
double zmax
Definition: liblwgeom.h:345
double zmin
Definition: liblwgeom.h:344
double mmax
Definition: liblwgeom.h:347
double mmin
Definition: liblwgeom.h:346
lwflags_t flags
Definition: liblwgeom.h:339

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 _lwt_FindFaceContainingRing(), lwgeom_same(), lwt_ChangeEdgeGeom(), test_gserialized1_peek_gbox_p_gets_correct_box(), test_gserialized2_peek_gbox_p_gets_correct_box(), test_lwgeom_from_gserialized(), test_lwgeom_from_gserialized2(), and test_lwgeom_voronoi_diagram_custom_envelope().

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