PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ geography_le()

Datum geography_le ( PG_FUNCTION_ARGS  )

Definition at line 92 of file geography_btree.c.

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

Referenced by geography_lt().

93 {
94  /* Put aside some stack memory and use it for GIDX pointers. */
95  char gboxmem1[GIDX_MAX_SIZE];
96  char gboxmem2[GIDX_MAX_SIZE];
97  GIDX *gbox1 = (GIDX*)gboxmem1;
98  GIDX *gbox2 = (GIDX*)gboxmem2;
99  POINT3D p1, p2;
100 
101  /* Must be able to build box for each argument (ie, not empty geometry) */
102  if ( ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(0), gbox1) ||
103  ! gserialized_datum_get_gidx_p(PG_GETARG_DATUM(1), gbox2) )
104  {
105  PG_RETURN_BOOL(FALSE);
106  }
107 
108  geography_gidx_center(gbox1, &p1);
109  geography_gidx_center(gbox2, &p2);
110 
111  if ( p1.x <= p2.x || p1.y <= p2.y || p1.z <= p2.z )
112  PG_RETURN_BOOL(TRUE);
113 
114  PG_RETURN_BOOL(FALSE);
115 }
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: