Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2d0e6b0f
Commit
2d0e6b0f
authored
Sep 01, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test new intersection and closest point operators.
Fix up results labels on queries.
parent
f2a9e203
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
src/test/regress/sql/geometry.sql
src/test/regress/sql/geometry.sql
+26
-26
No files found.
src/test/regress/sql/geometry.sql
View file @
2d0e6b0f
...
...
@@ -2,19 +2,19 @@
-- Points
--
SELECT
''
AS
xxx
,
center
(
f1
)
AS
center
SELECT
''
AS
four
,
center
(
f1
)
AS
center
FROM
BOX_TBL
;
SELECT
''
AS
xxx
,
(
@@
f1
)
AS
center
SELECT
''
AS
four
,
(
@@
f1
)
AS
center
FROM
BOX_TBL
;
SELECT
''
AS
xx
x
,
point
(
f1
)
AS
center
SELECT
''
AS
si
x
,
point
(
f1
)
AS
center
FROM
CIRCLE_TBL
;
SELECT
''
AS
xx
x
,
(
@@
f1
)
AS
center
SELECT
''
AS
si
x
,
(
@@
f1
)
AS
center
FROM
CIRCLE_TBL
;
SELECT
''
AS
xxx
,
(
@@
f1
)
AS
center
SELECT
''
AS
two
,
(
@@
f1
)
AS
center
FROM
POLYGON_TBL
WHERE
(
#
f1
)
>
2
;
...
...
@@ -43,11 +43,11 @@ SELECT '' AS one, p1.f1
--
-- intersection
SELECT
''
AS
xxx
,
p
.
f1
,
l
.
s
,
l
.
s
#
p
.
f1
AS
intersection
SELECT
''
AS
count
,
p
.
f1
,
l
.
s
,
l
.
s
#
p
.
f1
AS
intersection
FROM
LSEG_TBL
l
,
POINT_TBL
p
;
-- closest point
SELECT
''
AS
xxx
,
p
.
f1
,
l
.
s
,
p
.
f1
##
l
.
s
AS
closest
SELECT
''
AS
thirty
,
p
.
f1
,
l
.
s
,
p
.
f1
##
l
.
s
AS
closest
FROM
LSEG_TBL
l
,
POINT_TBL
p
;
--
...
...
@@ -58,20 +58,20 @@ SELECT '' AS xxx, p.f1, l.s, p.f1 ## l.s AS closest
-- Boxes
--
SELECT
box
(
f1
)
AS
box
FROM
CIRCLE_TBL
;
SELECT
''
as
six
,
box
(
f1
)
AS
box
FROM
CIRCLE_TBL
;
-- translation
SELECT
''
AS
count
,
b
.
f1
+
p
.
f1
AS
translation
SELECT
''
AS
twentyfour
,
b
.
f1
+
p
.
f1
AS
translation
FROM
BOX_TBL
b
,
POINT_TBL
p
;
SELECT
''
AS
count
,
b
.
f1
-
p
.
f1
AS
translation
SELECT
''
AS
twentyfour
,
b
.
f1
-
p
.
f1
AS
translation
FROM
BOX_TBL
b
,
POINT_TBL
p
;
-- scaling and rotation
SELECT
''
AS
count
,
b
.
f1
*
p
.
f1
AS
rotation
SELECT
''
AS
twentyfour
,
b
.
f1
*
p
.
f1
AS
rotation
FROM
BOX_TBL
b
,
POINT_TBL
p
;
SELECT
''
AS
count
,
b
.
f1
/
p
.
f1
AS
rotation
SELECT
''
AS
twenty
,
b
.
f1
/
p
.
f1
AS
rotation
FROM
BOX_TBL
b
,
POINT_TBL
p
WHERE
(
p
.
f1
<->
'(0,0)'
::
point
)
>=
1
;
...
...
@@ -81,9 +81,9 @@ SELECT '' AS count, b.f1 / p.f1 AS rotation
SET
geqo
TO
'off'
;
SELECT
''
AS
xxx
,
points
(
f1
)
AS
npoints
,
f1
AS
path
FROM
PATH_TBL
;
SELECT
''
AS
eight
,
points
(
f1
)
AS
npoints
,
f1
AS
path
FROM
PATH_TBL
;
SELECT
''
AS
xxx
,
path
(
f1
)
FROM
POLYGON_TBL
;
SELECT
''
AS
four
,
path
(
f1
)
FROM
POLYGON_TBL
;
-- translation
SELECT
''
AS
eight
,
p1
.
f1
+
'(10,10)'
::
point
AS
dist_add
...
...
@@ -100,46 +100,46 @@ RESET geqo;
--
-- containment
SELECT
''
AS
xxx
,
p
.
f1
,
poly
.
f1
,
poly
.
f1
~
p
.
f1
AS
contains
SELECT
''
AS
twentyfour
,
p
.
f1
,
poly
.
f1
,
poly
.
f1
~
p
.
f1
AS
contains
FROM
POLYGON_TBL
poly
,
POINT_TBL
p
;
SELECT
''
AS
xxx
,
p
.
f1
,
poly
.
f1
,
p
.
f1
@
poly
.
f1
AS
contained
SELECT
''
AS
twentyfour
,
p
.
f1
,
poly
.
f1
,
p
.
f1
@
poly
.
f1
AS
contained
FROM
POLYGON_TBL
poly
,
POINT_TBL
p
;
SELECT
''
AS
xxx
,
points
(
f1
)
AS
npoints
,
f1
AS
polygon
SELECT
''
AS
four
,
points
(
f1
)
AS
npoints
,
f1
AS
polygon
FROM
POLYGON_TBL
;
SELECT
''
AS
xxx
,
polygon
(
f1
)
SELECT
''
AS
four
,
polygon
(
f1
)
FROM
BOX_TBL
;
SELECT
''
AS
xxx
,
polygon
(
f1
)
SELECT
''
AS
four
,
polygon
(
f1
)
FROM
PATH_TBL
WHERE
isclosed
(
f1
);
SELECT
''
AS
xxx
,
f1
AS
open_path
,
polygon
(
pclose
(
f1
))
AS
polygon
SELECT
''
AS
four
,
f1
AS
open_path
,
polygon
(
pclose
(
f1
))
AS
polygon
FROM
PATH_TBL
WHERE
isopen
(
f1
);
-- convert circles to polygons using the default number of points
SELECT
''
AS
xx
x
,
polygon
(
f1
)
SELECT
''
AS
si
x
,
polygon
(
f1
)
FROM
CIRCLE_TBL
;
-- convert the circle to an 8-point polygon
SELECT
''
AS
xx
x
,
polygon
(
8
,
f1
)
SELECT
''
AS
si
x
,
polygon
(
8
,
f1
)
FROM
CIRCLE_TBL
;
--
-- Circles
--
SELECT
''
AS
xx
x
,
circle
(
f1
,
50
.
0
)
SELECT
''
AS
si
x
,
circle
(
f1
,
50
.
0
)
FROM
POINT_TBL
;
SELECT
''
AS
xxx
,
circle
(
f1
)
SELECT
''
AS
four
,
circle
(
f1
)
FROM
BOX_TBL
;
SELECT
''
AS
xxx
,
circle
(
f1
)
SELECT
''
AS
two
,
circle
(
f1
)
FROM
POLYGON_TBL
WHERE
(
#
f1
)
>=
2
;
WHERE
(
#
f1
)
>=
3
;
SELECT
''
AS
twentyfour
,
c1
.
f1
AS
circle
,
p1
.
f1
AS
point
,
(
p1
.
f1
<->
c1
.
f1
)
AS
distance
FROM
CIRCLE_TBL
c1
,
POINT_TBL
p1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment