PostGIS  2.5.0beta2dev-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 gidx_dimensionality_check(), and gidx_is_unknown().

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 void gidx_dimensionality_check(GIDX **a, GIDX **b)
bool gidx_is_unknown(const GIDX *a)
Here is the call graph for this function:
Here is the caller graph for this function: