PostgreSQL Source Code: src/backend/utils/adt/geo_spgist.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
75
81#include "utils/fmgroids.h"
82#include "utils/fmgrprotos.h"
84
85
86
87
88
89
90
91
92static int
94{
97
99 return 0;
101}
102
108
114
120
121
122
123
124
125
126
127
128
131{
133
136
139
142
145
147}
148
149
150
151
152
153
154
155
169
170
171
172
173
174
175
178{
181
184
187
190
193
195}
196
197
198
199
200
201
202
203
206{
208
210
213 else
215
218 else
220
223 else
225
228 else
230
232}
233
234
235static bool
241
242
243static bool
249
250
251static bool
257
258
259static bool
265
266
267static bool
275
276
277static bool
283
284
285static bool
291
292
293static bool
299
300
301static bool
307
308
309static bool
315
316
317static bool
322
323
324static bool
329
330
331static bool
336
337
338static bool
343
344
345static bool
350
351
352static bool
357
358
359static bool
364
365
366static bool
371
372
373static double
375{
376 double dx;
377 double dy;
378
381 else if (point->x > rect_box->range_box_x.right.high)
383 else
384 dx = 0;
385
388 else if (point->y > rect_box->range_box_y.right.high)
390 else
391 dy = 0;
392
394}
395
396
397
398
399
412
413
414
415
418{
423
426
427
430
432}
433
434
435
436
437
438
439
442{
447 i;
452
453
455 {
457
462 }
463
468
470
472
477
478
481
483 out->nodeLabels = NULL;
484
487
488
489
490
491
493 {
496
499 }
500
502}
503
504
505
506
507static bool
509{
510 switch (strategy)
511 {
520 return true;
521
522 default:
523 return false;
524 }
525}
526
527
528
529
530static BOX *
532{
533 switch (sk->sk_subtype)
534 {
537
540 *recheck = true;
542
543 default:
544 elog(ERROR, "unrecognized scankey subtype: %d", sk->sk_subtype);
546 }
547}
548
549
550
551
554{
557 int i;
562 **queries;
563
564
565
566
567
570 else
572
574 {
575
580
582 {
584 int j;
585
587 {
589
591 }
592
595
597 {
601 }
602 }
603
605 }
606
607
608
609
610
613 for (i = 0; i < in->nkeys; i++)
614 {
616
618 }
619
620
626
627
628
629
630
631
633
635 {
637 bool flag = true;
638
639 for (i = 0; i < in->nkeys; i++)
640 {
642
643 switch (strategy)
644 {
647 break;
648
651 break;
652
656 break;
657
660 break;
661
664 break;
665
668 break;
669
672 break;
673
676 break;
677
680 break;
681
684 break;
685
688 break;
689
690 default:
691 elog(ERROR, "unrecognized strategy: %d", strategy);
692 }
693
694
696 break;
697 }
698
700 {
703
705 {
707 int j;
708
710
712 {
714
716 }
717 }
718
720 }
721 else
722 {
723
724
725
726
728 }
729 }
730
731
733
735}
736
737
738
739
742{
746 bool flag = true;
747 int i;
748
749
751
752
753
754
755
756
759
760
761 for (i = 0; i < in->nkeys; i++)
762 {
767
768 switch (strategy)
769 {
772 query));
773 break;
774
777 query));
778 break;
779
782 query));
783 break;
784
787 query));
788 break;
789
792 query));
793 break;
794
797 query));
798 break;
799
802 query));
803 break;
804
807 query));
808 break;
809
812 query));
813 break;
814
817 query));
818 break;
819
822 query));
823 break;
824
827 query));
828 break;
829
830 default:
831 elog(ERROR, "unrecognized strategy: %d", strategy);
832 }
833
834
836 break;
837 }
838
840 {
842
845
846
848 }
849
851}
852
853
854
855
856
857
871
872
873
874
#define palloc_object(type)
#define palloc_array(type, count)
static float8 get_float8_infinity(void)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_BOOL(x)
static bool FPlt(double A, double B)
static bool FPge(double A, double B)
#define PG_RETURN_BOX_P(x)
static Point * DatumGetPointP(Datum X)
static POLYGON * DatumGetPolygonP(Datum X)
static BOX * DatumGetBoxP(Datum X)
#define PG_GETARG_POLYGON_P(n)
static bool FPgt(double A, double B)
static bool FPle(double A, double B)
static Datum BoxPGetDatum(const BOX *X)
Datum box_left(PG_FUNCTION_ARGS)
Datum box_right(PG_FUNCTION_ARGS)
Datum box_same(PG_FUNCTION_ARGS)
Datum box_below(PG_FUNCTION_ARGS)
Datum box_overright(PG_FUNCTION_ARGS)
Datum box_overabove(PG_FUNCTION_ARGS)
Datum box_overlap(PG_FUNCTION_ARGS)
Datum box_contain(PG_FUNCTION_ARGS)
Datum box_overbelow(PG_FUNCTION_ARGS)
Datum box_contained(PG_FUNCTION_ARGS)
Datum box_overleft(PG_FUNCTION_ARGS)
Datum box_above(PG_FUNCTION_ARGS)
static bool right4D(RectBox *rect_box, RangeBox *query)
Datum spg_box_quad_choose(PG_FUNCTION_ARGS)
static double pointToRectBoxDistance(Point *point, RectBox *rect_box)
static bool contain4D(RectBox *rect_box, RangeBox *query)
static bool overLower2D(RangeBox *range_box, Range *query)
static bool overRight4D(RectBox *rect_box, RangeBox *query)
static uint8 getQuadrant(BOX *centroid, BOX *inBox)
Datum spg_box_quad_leaf_consistent(PG_FUNCTION_ARGS)
Datum spg_box_quad_inner_consistent(PG_FUNCTION_ARGS)
static RectBox * initRectBox(void)
static RangeBox * getRangeBox(BOX *box)
static bool overlap2D(RangeBox *range_box, Range *query)
Datum spg_box_quad_picksplit(PG_FUNCTION_ARGS)
static int compareDoubles(const void *a, const void *b)
Datum spg_bbox_quad_config(PG_FUNCTION_ARGS)
Datum spg_box_quad_config(PG_FUNCTION_ARGS)
static bool overLeft4D(RectBox *rect_box, RangeBox *query)
static bool lower2D(RangeBox *range_box, Range *query)
static bool above4D(RectBox *rect_box, RangeBox *query)
static BOX * spg_box_quad_get_scankey_bbox(ScanKey sk, bool *recheck)
static bool contained4D(RectBox *rect_box, RangeBox *query)
static bool overBelow4D(RectBox *rect_box, RangeBox *query)
static bool higher2D(RangeBox *range_box, Range *query)
static bool overlap4D(RectBox *rect_box, RangeBox *query)
static RectBox * nextRectBox(RectBox *rect_box, RangeBox *centroid, uint8 quadrant)
static bool left4D(RectBox *rect_box, RangeBox *query)
static bool contained2D(RangeBox *range_box, Range *query)
static bool overAbove4D(RectBox *rect_box, RangeBox *query)
static bool is_bounding_box_test_exact(StrategyNumber strategy)
static bool below4D(RectBox *rect_box, RangeBox *query)
Datum spg_poly_quad_compress(PG_FUNCTION_ARGS)
static bool overHigher2D(RangeBox *range_box, Range *query)
static bool contain2D(RangeBox *range_box, Range *query)
void pfree(void *pointer)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#define qsort(a, b, c, d)
static bool DatumGetBool(Datum X)
double * spg_key_orderbys_distances(Datum key, bool isLeaf, ScanKey orderbys, int norderbys)
#define RTOverlapStrategyNumber
#define RTLeftStrategyNumber
#define RTOverRightStrategyNumber
#define RTRightStrategyNumber
#define RTSameStrategyNumber
#define RTOverAboveStrategyNumber
#define RTContainsStrategyNumber
#define RTOverBelowStrategyNumber
#define RTBelowStrategyNumber
#define RTAboveStrategyNumber
#define RTOverLeftStrategyNumber
#define RTContainedByStrategyNumber
StrategyNumber sk_strategy
union spgChooseOut::@56 result
spgChooseResultType resultType
struct spgChooseOut::@56::@57 matchNode
MemoryContext traversalMemoryContext