PostGIS  2.1.10dev-r@@SVN_REVISION@@
int gbox_same ( const GBOX g1,
const GBOX g2 

Check if 2 given Gbox are the same.

Definition at line 139 of file g_box.c.

References GBOX::flags, FLAGS_GET_M, FLAGS_GET_Z, FLAGS_GET_ZM, LW_FALSE, LW_TRUE, GBOX::mmax, GBOX::mmin, GBOX::xmax, GBOX::xmin, GBOX::ymax, GBOX::ymin, GBOX::zmax, and GBOX::zmin.

Referenced by lwgeom_same(), and test_lwgeom_from_gserialized().

140 {
141  if (FLAGS_GET_ZM(g1->flags) != FLAGS_GET_ZM(g2->flags))
142  return LW_FALSE;
144  if ( g1->xmin != g2->xmin || g1->ymin != g2->ymin ||
145  g1->xmax != g2->xmax || g1->ymax != g2->ymax ) return LW_FALSE;
147  if (FLAGS_GET_Z(g1->flags) && (g1->zmin != g2->zmin || g1->zmax != g2->zmax))
148  return LW_FALSE;
149  if (FLAGS_GET_M(g1->flags) && (g1->mmin != g2->mmin || g1->mmax != g2->mmax))
150  return LW_FALSE;
152  return LW_TRUE;
153 }
double xmax
Definition: liblwgeom.h:249
#define FLAGS_GET_ZM(flags)
Definition: liblwgeom.h:119
double zmax
Definition: liblwgeom.h:253
double ymin
Definition: liblwgeom.h:250
double xmin
Definition: liblwgeom.h:248
#define LW_FALSE
Definition: liblwgeom.h:52
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
double ymax
Definition: liblwgeom.h:251
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
uint8_t flags
Definition: liblwgeom.h:247
double mmin
Definition: liblwgeom.h:254
double zmin
Definition: liblwgeom.h:252
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:107
double mmax
Definition: liblwgeom.h:255

Here is the caller graph for this function: