forked from postgrespro/pgsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pgs_types.sql.in
191 lines (130 loc) · 3.22 KB
/
pgs_types.sql.in
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
-- Creates a type 'spherical point'
CREATE FUNCTION spoint_in(CSTRING)
RETURNS spoint
AS 'MODULE_PATHNAME', 'spherepoint_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION spoint_out(spoint)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'spherepoint_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE spoint (
internallength = 16,
input = spoint_in,
output = spoint_out
);
-- Creates a type 'spherical transformation'
CREATE FUNCTION strans_in(CSTRING)
RETURNS strans
AS 'MODULE_PATHNAME', 'spheretrans_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION strans_out(strans)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'spheretrans_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE strans (
internallength = 32,
input = strans_in,
output = strans_out
);
-- Creates a type 'spherical circle'
CREATE FUNCTION scircle_in(CSTRING)
RETURNS scircle
AS 'MODULE_PATHNAME', 'spherecircle_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION scircle_out(scircle)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'spherecircle_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE scircle (
internallength = 24,
input = scircle_in,
output = scircle_out
);
-- Creates a type 'spherical line'
CREATE FUNCTION sline_in(CSTRING)
RETURNS sline
AS 'MODULE_PATHNAME', 'sphereline_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION sline_out(sline)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'sphereline_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE sline (
internallength = 32,
input = sline_in,
output = sline_out
);
-- Creates a type 'spherical ellipse'
CREATE FUNCTION sellipse_in(CSTRING)
RETURNS sellipse
AS 'MODULE_PATHNAME', 'sphereellipse_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION sellipse_out(sellipse)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'sphereellipse_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE sellipse (
internallength = 40,
input = sellipse_in,
output = sellipse_out
);
-- Creates a type 'spherical polygon'
CREATE FUNCTION spoly_in(CSTRING)
RETURNS spoly
AS 'MODULE_PATHNAME', 'spherepoly_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION spoly_out(spoly)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'spherepoly_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE spoly (
internallength = VARIABLE,
input = spoly_in,
output = spoly_out,
storage = external
);
-- Creates a type 'spherical path'
CREATE FUNCTION spath_in(CSTRING)
RETURNS spath
AS 'MODULE_PATHNAME', 'spherepath_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION spath_out(spath)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'spherepath_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE spath (
internallength = VARIABLE,
input = spath_in,
output = spath_out,
storage = external
);
-- Creates a type 'spherical box'
CREATE FUNCTION sbox_in(CSTRING)
RETURNS sbox
AS 'MODULE_PATHNAME', 'spherebox_in'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE FUNCTION sbox_out(sbox)
RETURNS CSTRING
AS 'MODULE_PATHNAME', 'spherebox_out'
LANGUAGE 'c'
IMMUTABLE STRICT;
CREATE TYPE sbox (
internallength = 32,
input = sbox_in,
output = sbox_out
);