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

Definition at line 316 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().

317 {
318  int i;
319  int ndims_b;
320  POSTGIS_DEBUG(5, "entered function");
321 
322  if ( (a == NULL) || (b == NULL) ) return FALSE;
323 
324  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
325  return FALSE;
326 
327  /* Ensure 'a' has the most dimensions. */
329 
330  ndims_b = GIDX_NDIMS(b);
331 
332  /* compare only up to dimensions of (b), missing dimensions always overlap */
333  for ( i = 0; i < ndims_b; i++ )
334  {
335  if ( GIDX_GET_MIN(a,i) > GIDX_GET_MAX(b,i) )
336  return FALSE;
337  if ( GIDX_GET_MIN(b,i) > GIDX_GET_MAX(a,i) )
338  return FALSE;
339  }
340 
341  return TRUE;
342 }
static bool gidx_is_unknown(const GIDX *a)
static void gidx_dimensionality_check(GIDX **a, GIDX **b)
#define FALSE
Definition: dbfopen.c:169
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function:

Here is the caller graph for this function: