PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ geography_gt()

Datum geography_gt ( PG_FUNCTION_ARGS  )

Definition at line 107 of file geography_btree.c.

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

Referenced by geography_le().

108 {
109  /* Put aside some stack memory and use it for GIDX pointers. */
110  char gboxmem1[GIDX_MAX_SIZE];
111  char gboxmem2[GIDX_MAX_SIZE];
112  GIDX *gbox1 = (GIDX*)gboxmem1;
113  GIDX *gbox2 = (GIDX*)gboxmem2;
114  POINT3D p1, p2;
115 
116  /* Must be able to build box for each argument (ie, not empty geometry) */
117  if ( ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(0), gbox1) ||
118  ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(1), gbox2) )
119  {
120  PG_RETURN_BOOL(FALSE);
121  }
122 
123  geography_gidx_center(gbox1, &p1);
124  geography_gidx_center(gbox2, &p2);
125 
126  if ( p1.x > p2.x && p1.y > p2.y && p1.z > p2.z )
127  PG_RETURN_BOOL(TRUE);
128 
129  PG_RETURN_BOOL(FALSE);
130 }
double y
Definition: liblwgeom.h:324
double x
Definition: liblwgeom.h:324
double z
Definition: liblwgeom.h:324
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: