560 spgLeafConsistentIn *in = (spgLeafConsistentIn *)PG_GETARG_POINTER(0);
561 spgLeafConsistentOut *out = (spgLeafConsistentOut *)PG_GETARG_POINTER(1);
562 BOX2DF *key = (BOX2DF *)DatumGetPointer(in->leafDatum);
567 if (DatumGetPointer(key) == NULL)
569 POSTGIS_DEBUG(4,
"[SPGIST] null index entry, returning false");
570 PG_RETURN_BOOL(
false);
574 out->recheck =
false;
577 out->leafValue = in->leafDatum;
580 for (i = 0; i < in->nkeys; i++)
582 StrategyNumber strategy = in->scankeys[i].sk_strategy;
583 Datum query = in->scankeys[i].sk_argument;
584 BOX2DF query_gbox_index;
587 if (DatumGetPointer(query) == NULL)
589 POSTGIS_DEBUG(4,
"[SPGIST] null query pointer (!?!), returning false");
590 PG_RETURN_BOOL(
false);
595 POSTGIS_DEBUG(4,
"[SPGIST] null query_gbox_index!");
596 PG_RETURN_BOOL(
false);
601 case RTOverlapStrategyNumber:
605 case RTContainsStrategyNumber:
606 case RTOldContainsStrategyNumber:
610 case RTContainedByStrategyNumber:
611 case RTOldContainedByStrategyNumber:
615 case RTSameStrategyNumber:
619 case RTLeftStrategyNumber:
623 case RTOverLeftStrategyNumber:
627 case RTRightStrategyNumber:
631 case RTOverRightStrategyNumber:
635 case RTAboveStrategyNumber:
639 case RTOverAboveStrategyNumber:
643 case RTBelowStrategyNumber:
647 case RTOverBelowStrategyNumber:
652 elog(ERROR,
"unrecognized strategy: %d", strategy);
660 PG_RETURN_BOOL(flag);
bool box2df_left(const BOX2DF *a, const BOX2DF *b)
bool box2df_equals(const BOX2DF *a, const BOX2DF *b)
bool box2df_contains(const BOX2DF *a, const BOX2DF *b)
bool box2df_right(const BOX2DF *a, const BOX2DF *b)
bool box2df_overlaps(const BOX2DF *a, const BOX2DF *b)
bool box2df_above(const BOX2DF *a, const BOX2DF *b)
bool box2df_overbelow(const BOX2DF *a, const BOX2DF *b)
bool box2df_overright(const BOX2DF *a, const BOX2DF *b)
int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
Peak into a GSERIALIZED datum to find the bounding box.
bool box2df_overabove(const BOX2DF *a, const BOX2DF *b)
bool box2df_below(const BOX2DF *a, const BOX2DF *b)
bool box2df_overleft(const BOX2DF *a, const BOX2DF *b)