PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ gserialized_datum_predicate()

static int gserialized_datum_predicate ( Datum  gs1,
Datum  gs2,
gidx_predicate  predicate 
)
static

Support function.

Based on two datums return true if they satisfy the predicate and false otherwise.

Definition at line 442 of file gserialized_gist_nd.c.

References LW_FALSE, LW_SUCCESS, and LW_TRUE.

Referenced by gserialized_contains(), gserialized_overlaps(), and gserialized_within().

443 {
444  /* Put aside some stack memory and use it for GIDX pointers. */
445  char boxmem1[GIDX_MAX_SIZE];
446  char boxmem2[GIDX_MAX_SIZE];
447  GIDX *gidx1 = (GIDX*)boxmem1;
448  GIDX *gidx2 = (GIDX*)boxmem2;
449 
450  POSTGIS_DEBUG(3, "entered function");
451 
452  /* Must be able to build box for each arguement (ie, not empty geometry)
453  and predicate function to return true. */
454  if ( (gserialized_datum_get_gidx_p(gs1, gidx1) == LW_SUCCESS) &&
455  (gserialized_datum_get_gidx_p(gs2, gidx2) == LW_SUCCESS) &&
456  predicate(gidx1, gidx2) )
457  {
458  POSTGIS_DEBUGF(3, "got boxes %s and %s", gidx_to_string(gidx1), gidx_to_string(gidx2));
459  return LW_TRUE;
460  }
461  return LW_FALSE;
462 }
#define LW_SUCCESS
Definition: liblwgeom.h:65
#define LW_FALSE
Definition: liblwgeom.h:62
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
Here is the caller graph for this function: