PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ gserialized_datum_predicate_2d()

static int gserialized_datum_predicate_2d ( Datum  gs1,
Datum  gs2,
box2df_predicate  predicate 
)
static

Support function.

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

Definition at line 655 of file gserialized_gist_2d.c.

References box2df_to_string(), gserialized_datum_get_box2df_p(), LW_FALSE, LW_SUCCESS, and LW_TRUE.

Referenced by gserialized_above_2d(), gserialized_below_2d(), gserialized_contains_2d(), gserialized_left_2d(), gserialized_overabove_2d(), gserialized_overbelow_2d(), gserialized_overlaps_2d(), gserialized_overleft_2d(), gserialized_overright_2d(), gserialized_right_2d(), gserialized_same_2d(), and gserialized_within_2d().

656 {
657  BOX2DF b1, b2, *br1=NULL, *br2=NULL;
658  POSTGIS_DEBUG(3, "entered function");
659 
660  if (gserialized_datum_get_box2df_p(gs1, &b1) == LW_SUCCESS) br1 = &b1;
661  if (gserialized_datum_get_box2df_p(gs2, &b2) == LW_SUCCESS) br2 = &b2;
662 
663  if ( predicate(br1, br2) )
664  {
665  POSTGIS_DEBUGF(3, "got boxes %s and %s", br1 ? box2df_to_string(&b1) : "(null)", br2 ? box2df_to_string(&b2) : "(null)");
666  return LW_TRUE;
667  }
668  return LW_FALSE;
669 }
#define LW_SUCCESS
Definition: liblwgeom.h:80
static char * box2df_to_string(const BOX2DF *a)
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
Peak into a GSERIALIZED datum to find the bounding box.
Here is the call graph for this function:
Here is the caller graph for this function: