PostGIS  2.2.7dev-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 141 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(), and test_lwgeom_from_gserialized().

142 {
143  if (FLAGS_GET_ZM(g1->flags) != FLAGS_GET_ZM(g2->flags))
144  return LW_FALSE;
146  if (!gbox_same_2d(g1, g2)) return LW_FALSE;
148  if (FLAGS_GET_Z(g1->flags) && (g1->zmin != g2->zmin || g1->zmax != g2->zmax))
149  return LW_FALSE;
150  if (FLAGS_GET_M(g1->flags) && (g1->mmin != g2->mmin || g1->mmax != g2->mmax))
151  return LW_FALSE;
153  return LW_TRUE;
154 }
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:137
double zmax
Definition: liblwgeom.h:281
#define LW_FALSE
Definition: liblwgeom.h:62
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
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:156
uint8_t flags
Definition: liblwgeom.h:275
double mmin
Definition: liblwgeom.h:282
double zmin
Definition: liblwgeom.h:280
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
double mmax
Definition: liblwgeom.h:283
Here is the call graph for this function:
Here is the caller graph for this function: