PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gidx_overlaps()

static bool gidx_overlaps ( GIDX *  a,
GIDX *  b 
)
static

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

352 {
353  int i;
354  int ndims_b;
355  POSTGIS_DEBUG(5, "entered function");
356 
357  if ( (a == NULL) || (b == NULL) ) return FALSE;
358 
359  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
360  return FALSE;
361 
362  /* Ensure 'a' has the most dimensions. */
364 
365  ndims_b = GIDX_NDIMS(b);
366 
367  /* compare only up to dimensions of (b), missing dimensions always overlap */
368  for ( i = 0; i < ndims_b; i++ )
369  {
370  if ( GIDX_GET_MIN(a,i) > GIDX_GET_MAX(b,i) )
371  return FALSE;
372  if ( GIDX_GET_MIN(b,i) > GIDX_GET_MAX(a,i) )
373  return FALSE;
374  }
375 
376  return TRUE;
377 }
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: