PostGIS  2.2.7dev-r@@SVN_REVISION@@
static bool gidx_overlaps ( GIDX *  a,
GIDX *  b 
)
static

Definition at line 321 of file gserialized_gist_nd.c.

References FALSE, gidx_dimensionality_check(), gidx_is_unknown(), and TRUE.

Referenced by gserialized_gist_consistent_internal(), gserialized_gist_consistent_leaf(), and gserialized_overlaps().

322 {
323  int i;
324  int ndims_b;
325  POSTGIS_DEBUG(5, "entered function");
326 
327  if ( (a == NULL) || (b == NULL) ) return FALSE;
328 
329  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
330  return FALSE;
331 
332  /* Ensure 'a' has the most dimensions. */
334 
335  ndims_b = GIDX_NDIMS(b);
336 
337  /* compare only up to dimensions of (b), missing dimensions always overlap */
338  for ( i = 0; i < ndims_b; i++ )
339  {
340  if ( GIDX_GET_MIN(a,i) > GIDX_GET_MAX(b,i) )
341  return FALSE;
342  if ( GIDX_GET_MIN(b,i) > GIDX_GET_MAX(a,i) )
343  return FALSE;
344  }
345 
346  return TRUE;
347 }
static bool gidx_is_unknown(const GIDX *a)
static void gidx_dimensionality_check(GIDX **a, GIDX **b)
#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: