558 spgLeafConsistentIn *in = (spgLeafConsistentIn *)PG_GETARG_POINTER(0);
559 spgLeafConsistentOut *out = (spgLeafConsistentOut *)PG_GETARG_POINTER(1);
560 BOX2DF *key = (BOX2DF *)DatumGetPointer(in->leafDatum);
565 if (DatumGetPointer(key) == NULL)
567 POSTGIS_DEBUG(4,
"[SPGIST] null index entry, returning false");
568 PG_RETURN_BOOL(
false);
572 out->recheck =
false;
575 out->leafValue = in->leafDatum;
578 for (i = 0; i < in->nkeys; i++)
580 StrategyNumber strategy = in->scankeys[i].sk_strategy;
581 Datum query = in->scankeys[i].sk_argument;
582 BOX2DF query_gbox_index;
585 if (DatumGetPointer(query) == NULL)
587 POSTGIS_DEBUG(4,
"[SPGIST] null query pointer (!?!), returning false");
588 PG_RETURN_BOOL(
false);
593 POSTGIS_DEBUG(4,
"[SPGIST] null query_gbox_index!");
594 PG_RETURN_BOOL(
false);
599 case RTOverlapStrategyNumber:
603 case RTContainsStrategyNumber:
604 case RTOldContainsStrategyNumber:
608 case RTContainedByStrategyNumber:
609 case RTOldContainedByStrategyNumber:
613 case RTSameStrategyNumber:
617 case RTLeftStrategyNumber:
621 case RTOverLeftStrategyNumber:
625 case RTRightStrategyNumber:
629 case RTOverRightStrategyNumber:
633 case RTAboveStrategyNumber:
637 case RTOverAboveStrategyNumber:
641 case RTBelowStrategyNumber:
645 case RTOverBelowStrategyNumber:
650 elog(ERROR,
"unrecognized strategy: %d", strategy);
658 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)