PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ geography_ge()

Datum geography_ge ( PG_FUNCTION_ARGS  )

Definition at line 152 of file geography_btree.c.

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

Referenced by geography_gt().

153 {
154  /* Put aside some stack memory and use it for GIDX pointers. */
155  char gboxmem1[GIDX_MAX_SIZE];
156  char gboxmem2[GIDX_MAX_SIZE];
157  GIDX *gbox1 = (GIDX*)gboxmem1;
158  GIDX *gbox2 = (GIDX*)gboxmem2;
159  POINT3D p1, p2;
160 
161  /* Must be able to build box for each argument (ie, not empty geometry) */
162  if ( ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(0), gbox1) ||
163  ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(1), gbox2) )
164  {
165  PG_RETURN_BOOL(FALSE);
166  }
167 
168  geography_gidx_center(gbox1, &p1);
169  geography_gidx_center(gbox2, &p2);
170 
171  if ( p1.x >= p2.x && p1.y >= p2.y && p1.z >= p2.z )
172  PG_RETURN_BOOL(TRUE);
173 
174  PG_RETURN_BOOL(FALSE);
175 }
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 TRUE
Definition: dbfopen.c:169
Here is the call graph for this function:
Here is the caller graph for this function: