PostGIS  2.3.7dev-r@@SVN_REVISION@@
Datum geography_eq ( PG_FUNCTION_ARGS  )

Definition at line 216 of file geography_btree.c.

References FALSE, FP_EQUALS, geography_gidx_center(), TRUE, POINT3D::x, POINT3D::y, and POINT3D::z.

217 {
218  /* Put aside some stack memory and use it for GIDX pointers. */
219  char gboxmem1[GIDX_MAX_SIZE];
220  char gboxmem2[GIDX_MAX_SIZE];
221  GIDX *gbox1 = (GIDX*)gboxmem1;
222  GIDX *gbox2 = (GIDX*)gboxmem2;
223  POINT3D p1, p2;
224 
225  /* Must be able to build box for each argument (ie, not empty geometry) */
226  if ( ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(0), gbox1) ||
227  ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(1), gbox2) )
228  {
229  PG_RETURN_BOOL(FALSE);
230  }
231 
232  geography_gidx_center(gbox1, &p1);
233  geography_gidx_center(gbox2, &p2);
234 
235  if ( FP_EQUALS(p1.x, p2.x) && FP_EQUALS(p1.y, p2.y) && FP_EQUALS(p1.z, p2.z) )
236  PG_RETURN_BOOL(TRUE);
237 
238  PG_RETURN_BOOL(FALSE);
239 
240 }
double y
Definition: liblwgeom.h:339
double x
Definition: liblwgeom.h:339
double z
Definition: liblwgeom.h:339
static void geography_gidx_center(GIDX *gidx, POINT3D *p)
#define FALSE
Definition: dbfopen.c:168
#define FP_EQUALS(A, B)
#define TRUE
Definition: dbfopen.c:169

Here is the call graph for this function: