PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ gidx_overlaps()

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

Definition at line 417 of file gserialized_gist_nd.c.

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

Referenced by gserialized_gidx_geog_overlaps(), gserialized_gidx_geom_overlaps(), gserialized_gidx_gidx_overlaps(), gserialized_gist_consistent_internal(), gserialized_gist_consistent_leaf(), and gserialized_overlaps().

418 {
419  int i;
420  int ndims_b;
421  POSTGIS_DEBUG(5, "entered function");
422 
423  if ( (a == NULL) || (b == NULL) ) return FALSE;
424 
425  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
426  return FALSE;
427 
428  /* Ensure 'a' has the most dimensions. */
430 
431  ndims_b = GIDX_NDIMS(b);
432 
433  /* compare only up to dimensions of (b), missing dimensions always overlap */
434  for ( i = 0; i < ndims_b; i++ )
435  {
436  if ( GIDX_GET_MIN(a,i) > GIDX_GET_MAX(b,i) )
437  return FALSE;
438  if ( GIDX_GET_MIN(b,i) > GIDX_GET_MAX(a,i) )
439  return FALSE;
440  }
441 
442  return TRUE;
443 }
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: