Skip to content

Commit 2d0e6b0

Browse files
author
Thomas G. Lockhart
committed
Test new intersection and closest point operators.
Fix up results labels on queries.
1 parent f2a9e20 commit 2d0e6b0

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/test/regress/sql/geometry.sql

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
-- Points
33
--
44

5-
SELECT '' AS xxx, center(f1) AS center
5+
SELECT '' AS four, center(f1) AS center
66
FROM BOX_TBL;
77

8-
SELECT '' AS xxx, (@@ f1) AS center
8+
SELECT '' AS four, (@@ f1) AS center
99
FROM BOX_TBL;
1010

11-
SELECT '' AS xxx, point(f1) AS center
11+
SELECT '' AS six, point(f1) AS center
1212
FROM CIRCLE_TBL;
1313

14-
SELECT '' AS xxx, (@@ f1) AS center
14+
SELECT '' AS six, (@@ f1) AS center
1515
FROM CIRCLE_TBL;
1616

17-
SELECT '' AS xxx, (@@ f1) AS center
17+
SELECT '' AS two, (@@ f1) AS center
1818
FROM POLYGON_TBL
1919
WHERE (# f1) > 2;
2020

@@ -43,11 +43,11 @@ SELECT '' AS one, p1.f1
4343
--
4444

4545
-- intersection
46-
SELECT '' AS xxx, p.f1, l.s, l.s # p.f1 AS intersection
46+
SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
4747
FROM LSEG_TBL l, POINT_TBL p;
4848

4949
-- closest point
50-
SELECT '' AS xxx, p.f1, l.s, p.f1 ## l.s AS closest
50+
SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
5151
FROM LSEG_TBL l, POINT_TBL p;
5252

5353
--
@@ -58,20 +58,20 @@ SELECT '' AS xxx, p.f1, l.s, p.f1 ## l.s AS closest
5858
-- Boxes
5959
--
6060

61-
SELECT box(f1) AS box FROM CIRCLE_TBL;
61+
SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL;
6262

6363
-- translation
64-
SELECT '' AS count, b.f1 + p.f1 AS translation
64+
SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
6565
FROM BOX_TBL b, POINT_TBL p;
6666

67-
SELECT '' AS count, b.f1 - p.f1 AS translation
67+
SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
6868
FROM BOX_TBL b, POINT_TBL p;
6969

7070
-- scaling and rotation
71-
SELECT '' AS count, b.f1 * p.f1 AS rotation
71+
SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
7272
FROM BOX_TBL b, POINT_TBL p;
7373

74-
SELECT '' AS count, b.f1 / p.f1 AS rotation
74+
SELECT '' AS twenty, b.f1 / p.f1 AS rotation
7575
FROM BOX_TBL b, POINT_TBL p
7676
WHERE (p.f1 <-> '(0,0)'::point) >= 1;
7777

@@ -81,9 +81,9 @@ SELECT '' AS count, b.f1 / p.f1 AS rotation
8181

8282
SET geqo TO 'off';
8383

84-
SELECT '' AS xxx, points(f1) AS npoints, f1 AS path FROM PATH_TBL;
84+
SELECT '' AS eight, points(f1) AS npoints, f1 AS path FROM PATH_TBL;
8585

86-
SELECT '' AS xxx, path(f1) FROM POLYGON_TBL;
86+
SELECT '' AS four, path(f1) FROM POLYGON_TBL;
8787

8888
-- translation
8989
SELECT '' AS eight, p1.f1 + '(10,10)'::point AS dist_add
@@ -100,46 +100,46 @@ RESET geqo;
100100
--
101101

102102
-- containment
103-
SELECT '' AS xxx, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
103+
SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
104104
FROM POLYGON_TBL poly, POINT_TBL p;
105105

106-
SELECT '' AS xxx, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
106+
SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
107107
FROM POLYGON_TBL poly, POINT_TBL p;
108108

109-
SELECT '' AS xxx, points(f1) AS npoints, f1 AS polygon
109+
SELECT '' AS four, points(f1) AS npoints, f1 AS polygon
110110
FROM POLYGON_TBL;
111111

112-
SELECT '' AS xxx, polygon(f1)
112+
SELECT '' AS four, polygon(f1)
113113
FROM BOX_TBL;
114114

115-
SELECT '' AS xxx, polygon(f1)
115+
SELECT '' AS four, polygon(f1)
116116
FROM PATH_TBL WHERE isclosed(f1);
117117

118-
SELECT '' AS xxx, f1 AS open_path, polygon( pclose(f1)) AS polygon
118+
SELECT '' AS four, f1 AS open_path, polygon( pclose(f1)) AS polygon
119119
FROM PATH_TBL
120120
WHERE isopen(f1);
121121

122122
-- convert circles to polygons using the default number of points
123-
SELECT '' AS xxx, polygon(f1)
123+
SELECT '' AS six, polygon(f1)
124124
FROM CIRCLE_TBL;
125125

126126
-- convert the circle to an 8-point polygon
127-
SELECT '' AS xxx, polygon(8, f1)
127+
SELECT '' AS six, polygon(8, f1)
128128
FROM CIRCLE_TBL;
129129

130130
--
131131
-- Circles
132132
--
133133

134-
SELECT '' AS xxx, circle(f1, 50.0)
134+
SELECT '' AS six, circle(f1, 50.0)
135135
FROM POINT_TBL;
136136

137-
SELECT '' AS xxx, circle(f1)
137+
SELECT '' AS four, circle(f1)
138138
FROM BOX_TBL;
139139

140-
SELECT '' AS xxx, circle(f1)
140+
SELECT '' AS two, circle(f1)
141141
FROM POLYGON_TBL
142-
WHERE (# f1) >= 2;
142+
WHERE (# f1) >= 3;
143143

144144
SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS distance
145145
FROM CIRCLE_TBL c1, POINT_TBL p1

0 commit comments

Comments
 (0)