559{
560 spgLeafConsistentIn *in = (spgLeafConsistentIn *)PG_GETARG_POINTER(0);
561 spgLeafConsistentOut *out = (spgLeafConsistentOut *)PG_GETARG_POINTER(1);
562 BOX2DF *key = (BOX2DF *)DatumGetPointer(in->leafDatum);
563 bool flag = true;
564 int i;
565
566
567 if (key == NULL)
568 {
569 POSTGIS_DEBUG(4, "[SPGIST] null index entry, returning false");
570 PG_RETURN_BOOL(false);
571 }
572
573
574 out->recheck = false;
575
576
577 out->leafValue = in->leafDatum;
578
579
580 for (i = 0; i < in->nkeys; i++)
581 {
582 StrategyNumber strategy = in->scankeys[i].sk_strategy;
583 Datum query = in->scankeys[i].sk_argument;
584 BOX2DF query_gbox_index;
585
586
587 if (DatumGetPointer(query) == NULL)
588 {
589 POSTGIS_DEBUG(4, "[SPGIST] null query pointer (!?!), returning false");
590 PG_RETURN_BOOL(false);
591 }
592
594 {
595 POSTGIS_DEBUG(4, "[SPGIST] null query_gbox_index!");
596 PG_RETURN_BOOL(false);
597 }
598
599 switch (strategy)
600 {
601 case RTOverlapStrategyNumber:
603 break;
604
605 case RTContainsStrategyNumber:
606 case RTOldContainsStrategyNumber:
608 break;
609
610 case RTContainedByStrategyNumber:
611 case RTOldContainedByStrategyNumber:
613 break;
614
615 case RTSameStrategyNumber:
617 break;
618
619 case RTLeftStrategyNumber:
621 break;
622
623 case RTOverLeftStrategyNumber:
625 break;
626
627 case RTRightStrategyNumber:
629 break;
630
631 case RTOverRightStrategyNumber:
633 break;
634
635 case RTAboveStrategyNumber:
637 break;
638
639 case RTOverAboveStrategyNumber:
641 break;
642
643 case RTBelowStrategyNumber:
645 break;
646
647 case RTOverBelowStrategyNumber:
649 break;
650
651 default:
652 elog(ERROR, "unrecognized strategy: %d", strategy);
653 }
654
655
656 if (!flag)
657 break;
658 }
659
660 PG_RETURN_BOOL(flag);
661}
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)
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)