1-- Repeat tests with new function names.
2SELECT 'ndims01', ST_ndims(ST_geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
3                -2 0 0 0,
4                -1 -1 1 2,
5                0 0 2 4,
6                1 -1 3 6,
7                2 0 4 8,
8                0 2 2 4,
9                -2 0 0 0),
10                (-1 0 1 2,
11                0 0.5 2 4,
12                1 0 3 6,
13                0 1 3 4,
14                -1 0 1 2))'));
15SELECT 'geometrytype01', geometrytype(ST_geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
16                -2 0 0 0,
17                -1 -1 1 2,
18                0 0 2 4,
19                1 -1 3 6,
20                2 0 4 8,
21                0 2 2 4,
22                -2 0 0 0),
23                (-1 0 1 2,
24                0 0.5 2 4,
25                1 0 3 6,
26                0 1 3 4,
27                -1 0 1 2))'));
28SELECT 'ndims02', ST_ndims(ST_geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
29                -2 0 0,
30                -1 -1 1,
31                0 0 2,
32                1 -1 3,
33                2 0 4,
34                0 2 2,
35                -2 0 0),
36                (-1 0 1,
37                0 0.5 2,
38                1 0 3,
39                0 1 3,
40                -1 0 1))'));
41SELECT 'geometrytype02', geometrytype(ST_geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
42                -2 0 0,
43                -1 -1 1,
44                0 0 2,
45                1 -1 3,
46                2 0 4,
47                0 2 2,
48                -2 0 0),
49                (-1 0 1,
50                0 0.5 2,
51                1 0 3,
52                0 1 3,
53                -1 0 1))'));
54SELECT 'ndims03', ST_ndims(ST_geomfromewkt('CURVEPOLYGONM(CIRCULARSTRING(
55                -2 0 0,
56                -1 -1 2,
57                0 0 4,
58                1 -1 6,
59                2 0 8,
60                0 2 4,
61                -2 0 0),
62                (-1 0 2,
63                0 0.5 4,
64                1 0 6,
65                0 1 4,
66                -1 0 2))'));
67SELECT 'geometrytype03', geometrytype(ST_geomfromewkt('CURVEPOLYGONM(CIRCULARSTRING(
68                -2 0 0,
69                -1 -1 2,
70                0 0 4,
71                1 -1 6,
72                2 0 8,
73                0 2 4,
74                -2 0 0),
75                (-1 0 2,
76                0 0.5 4,
77                1 0 6,
78                0 1 4,
79                -1 0 2))'));
80SELECT 'ndims04', ST_ndims(ST_geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
81                -2 0,
82                -1 -1,
83                0 0,
84                1 -1,
85                2 0,
86                0 2,
87                -2 0),
88                (-1 0,
89                0 0.5,
90                1 0,
91                0 1,
92                -1 0))'));
93SELECT 'geometrytype04', geometrytype(ST_geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
94                -2 0,
95                -1 -1,
96                0 0,
97                1 -1,
98                2 0,
99                0 2,
100                -2 0),
101                (-1 0,
102                0 0.5,
103                1 0,
104                0 1,
105                -1 0))'));
106
107SELECT 'ndims05', ST_Ndims(ST_geomfromewkt('CURVEPOLYGON(
108                COMPOUNDCURVE(
109                    (5 5 1 0,5 0 1 1,0 0 1 2,0 5 1 3),
110                    CIRCULARSTRING(0 5 1 3,1.5 7.5 1 4,5 5 1 0)),
111                (1.5 5 2 0,2.5 6 3 1,3.5 5 2 2,1.5 5 2 0),
112                COMPOUNDCURVE(
113                    CIRCULARSTRING(1.5 2 2 0,1 2.5 3 1,3.5 2 2 2),
114                    (3.5 2 2 2,3.5 4 1 3,1.5 4 1 4,1.5 2 2 0)))'));
115
116CREATE TABLE public.curvepolygon (id INTEGER, description VARCHAR,
117the_geom_2d GEOMETRY(CURVEPOLYGON),
118the_geom_3dm GEOMETRY(CURVEPOLYGONM),
119the_geom_3dz GEOMETRY(CURVEPOLYGONZ),
120the_geom_4d GEOMETRY(CURVEPOLYGONZM));
121
122INSERT INTO public.curvepolygon (
123                id,
124                description
125              ) VALUES (
126                1, 'curvepolygon');
127UPDATE public.curvepolygon
128        SET the_geom_4d = ST_Geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
129                -2 0 0 0,
130                -1 -1 1 2,
131                0 0 2 4,
132                1 -1 3 6,
133                2 0 4 8,
134                0 2 2 4,
135                -2 0 0 0),
136                (-1 0 1 2,
137                0 0.5 2 4,
138                1 0 3 6,
139                0 1 3 4,
140                -1 0 1 2))');
141UPDATE public.curvepolygon
142        SET the_geom_3dz = ST_Geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
143                -2 0 0,
144                -1 -1 1,
145                0 0 2,
146                1 -1 3,
147                2 0 4,
148                0 2 2,
149                -2 0 0),
150                (-1 0 1,
151                0 0.5 2,
152                1 0 3,
153                0 1 3,
154                -1 0 1))');
155UPDATE public.curvepolygon
156        SET the_geom_3dm = ST_Geomfromewkt('CURVEPOLYGONM(CIRCULARSTRING(
157                -2 0 0,
158                -1 -1 2,
159                0 0 4,
160                1 -1 6,
161                2 0 8,
162                0 2 4,
163                -2 0 0),
164                (-1 0 2,
165                0 0.5 4,
166                1 0 6,
167                0 1 4,
168                -1 0 2))');
169UPDATE public.curvepolygon
170        SET the_geom_2d = ST_Geomfromewkt('CURVEPOLYGON(CIRCULARSTRING(
171                -2 0,
172                -1 -1,
173                0 0,
174                1 -1,
175                2 0,
176                0 2,
177                -2 0),
178                (-1 0,
179                0 0.5,
180                1 0,
181                0 1,
182                -1 0))');
183
184SELECT 'asbinary01', encode(ST_AsBinary(the_geom_2d, 'ndr'), 'hex') FROM public.curvepolygon;
185SELECT 'asbinary02', encode(ST_AsBinary(the_geom_3dm, 'xdr'), 'hex') FROM public.curvepolygon;
186SELECT 'asbinary03', encode(ST_AsBinary(the_geom_3dz, 'ndr'), 'hex') FROM public.curvepolygon;
187SELECT 'asbinary04', encode(ST_AsBinary(the_geom_4d, 'xdr'), 'hex') FROM public.curvepolygon;
188
189SELECT 'asewkb01', encode(ST_AsEWKB(the_geom_2d, 'xdr'), 'hex') FROM public.curvepolygon;
190SELECT 'asewkb02', encode(ST_AsEWKB(the_geom_3dm, 'ndr'), 'hex') FROM public.curvepolygon;
191SELECT 'asewkb03', encode(ST_AsEWKB(the_geom_3dz, 'xdr'), 'hex') FROM public.curvepolygon;
192SELECT 'asewkb04', encode(ST_AsEWKB(the_geom_4d, 'ndr'), 'hex') FROM public.curvepolygon;
193
194SELECT 'ST_CurveToLine-201',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_2d, 2), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
195SELECT 'ST_CurveToLine-202',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_3dm, 2), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
196SELECT 'ST_CurveToLine-203',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_3dz, 2), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
197SELECT 'ST_CurveToLine-204',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_4d, 2), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
198
199SELECT 'ST_CurveToLine-401',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_2d, 4), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
200SELECT 'ST_CurveToLine-402',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_3dm, 4), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
201SELECT 'ST_CurveToLine-403',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_3dz, 4), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
202SELECT 'ST_CurveToLine-404',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_4d, 4), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
203
204SELECT 'ST_CurveToLine01',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_2d), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
205SELECT 'ST_CurveToLine02',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_3dm), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
206SELECT 'ST_CurveToLine03',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_3dz), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
207SELECT 'ST_CurveToLine04',ST_AsEWKT(ST_SnapToGrid(ST_CurveToLine(the_geom_4d), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
208
209-- TODO: ST_SnapToGrid is required to remove platform dependent precision
210-- issues.  Until ST_SnapToGrid is updated to work against curves, these
211-- tests cannot be run.
212--SELECT 'ST_LineToCurve01',ST_AsEWKT(ST_LineToCurve(ST_CurveToLine(the_geom_2d))) FROM public.curvepolygon;
213--SELECT 'ST_LineToCurve02',ST_AsEWKT(ST_LineToCurve(ST_CurveToLine(the_geom_3dm))) FROM public.curvepolygon;
214--SELECT 'ST_LineToCurve03',ST_AsEWKT(ST_LineToCurve(ST_CurveToLine(the_geom_3dz))) FROM public.curvepolygon;
215--SELECT 'ST_LineToCurve04',ST_AsEWKT(ST_LineToCurve(ST_CurveToLine(the_geom_4d))) FROM public.curvepolygon;
216
217-- Repeat tests with new function names.
218SELECT 'astext01', ST_AsText(the_geom_2d) FROM public.curvepolygon;
219SELECT 'astext02', ST_AsText(the_geom_3dm) FROM public.curvepolygon;
220SELECT 'astext03', ST_AsText(the_geom_3dz) FROM public.curvepolygon;
221SELECT 'astext04', ST_AsText(the_geom_4d) FROM public.curvepolygon;
222
223SELECT 'asewkt01', ST_AsEWKT(the_geom_2d) FROM public.curvepolygon;
224SELECT 'asewkt02', ST_AsEWKT(the_geom_3dm) FROM public.curvepolygon;
225SELECT 'asewkt03', ST_AsEWKT(the_geom_3dz) FROM public.curvepolygon;
226SELECT 'asewkt04', ST_AsEWKT(the_geom_4d) FROM public.curvepolygon;
227
228SELECT 'isValid01', ST_IsValid(the_geom_2d) FROM public.curvepolygon;
229SELECT 'isValid02', ST_IsValid(the_geom_3dm) FROM public.curvepolygon;
230SELECT 'isValid03', ST_IsValid(the_geom_3dz) FROM public.curvepolygon;
231SELECT 'isValid04', ST_IsValid(the_geom_4d) FROM public.curvepolygon;
232
233SELECT 'dimension01', ST_dimension(the_geom_2d) FROM public.curvepolygon;
234SELECT 'dimension02', ST_dimension(the_geom_3dm) FROM public.curvepolygon;
235SELECT 'dimension03', ST_dimension(the_geom_3dz) FROM public.curvepolygon;
236SELECT 'dimension04', ST_dimension(the_geom_4d) FROM public.curvepolygon;
237
238SELECT 'SRID01', ST_SRID(the_geom_2d) FROM public.curvepolygon;
239SELECT 'SRID02', ST_SRID(the_geom_3dm) FROM public.curvepolygon;
240SELECT 'SRID03', ST_SRID(the_geom_3dz) FROM public.curvepolygon;
241SELECT 'SRID04', ST_SRID(the_geom_4d) FROM public.curvepolygon;
242
243SELECT 'envelope01', ST_AsText(ST_snapToGrid(ST_envelope(the_geom_2d), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
244SELECT 'envelope02', ST_AsText(ST_snapToGrid(ST_envelope(the_geom_3dm), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
245SELECT 'envelope03', ST_AsText(ST_snapToGrid(ST_envelope(the_geom_3dz), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
246SELECT 'envelope04', ST_AsText(ST_snapToGrid(ST_envelope(the_geom_4d), 'POINT(0 0 0 0)'::geometry, 1e-8, 1e-8, 1e-8, 1e-8)) FROM public.curvepolygon;
247
248SELECT 'startPoint01', (ST_startPoint(the_geom_2d) is null) FROM public.curvepolygon;
249SELECT 'startPoint02', (ST_startPoint(the_geom_3dm) is null) FROM public.curvepolygon;
250SELECT 'startPoint03', (ST_startPoint(the_geom_3dz) is null) FROM public.curvepolygon;
251SELECT 'startPoint04', (ST_startPoint(the_geom_4d) is null) FROM public.curvepolygon;
252
253SELECT 'endPoint01', (ST_endPoint(the_geom_2d) is null) FROM public.curvepolygon;
254SELECT 'endPoint02', (ST_endPoint(the_geom_3dm) is null) FROM public.curvepolygon;
255SELECT 'endPoint03', (ST_endPoint(the_geom_3dz) is null) FROM public.curvepolygon;
256SELECT 'endPoint04', (ST_endPoint(the_geom_4d) is null) FROM public.curvepolygon;
257
258SELECT 'exteriorRing01', ST_AsEWKT(ST_exteriorRing(the_geom_2d)) FROM public.curvepolygon;
259SELECT 'exteriorRing02', ST_AsEWKT(ST_exteriorRing(the_geom_3dm)) FROM public.curvepolygon;
260SELECT 'exteriorRing03', ST_AsEWKT(ST_exteriorRing(the_geom_3dz)) FROM public.curvepolygon;
261SELECT 'exteriorRing04', ST_AsEWKT(ST_exteriorRing(the_geom_4d)) FROM public.curvepolygon;
262
263SELECT 'numInteriorRings01', ST_numInteriorRings(the_geom_2d) FROM public.curvepolygon;
264SELECT 'numInteriorRings02', ST_numInteriorRings(the_geom_3dm) FROM public.curvepolygon;
265SELECT 'numInteriorRings03', ST_numInteriorRings(the_geom_3dz) FROM public.curvepolygon;
266SELECT 'numInteriorRings04', ST_numInteriorRings(the_geom_4d) FROM public.curvepolygon;
267
268SELECT 'interiorRingN-101', ST_AsEWKT(ST_InteriorRingN(the_geom_2d, 1)) FROM public.curvepolygon;
269SELECT 'interiorRingN-102', ST_AsEWKT(ST_InteriorRingN(the_geom_3dm, 1)) FROM public.curvepolygon;
270SELECT 'interiorRingN-103', ST_AsEWKT(ST_InteriorRingN(the_geom_3dz, 1)) FROM public.curvepolygon;
271SELECT 'interiorRingN-104', ST_AsEWKT(ST_InteriorRingN(the_geom_4d, 1)) FROM public.curvepolygon;
272
273SELECT 'interiorRingN-201', ST_AsEWKT(ST_InteriorRingN(the_geom_2d, 2)) FROM public.curvepolygon;
274SELECT 'interiorRingN-202', ST_AsEWKT(ST_InteriorRingN(the_geom_3dm, 2)) FROM public.curvepolygon;
275SELECT 'interiorRingN-203', ST_AsEWKT(ST_InteriorRingN(the_geom_3dz, 2)) FROM public.curvepolygon;
276SELECT 'interiorRingN-204', ST_AsEWKT(ST_InteriorRingN(the_geom_4d, 2)) FROM public.curvepolygon;
277
278DROP TABLE public.curvepolygon;
279
280SELECT 'valid wkt curve polygon 1', encode(ST_AsBinary(ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827))'),'ndr'),'hex');
281SELECT 'valid wkt curve polygon 2', encode(ST_AsBinary(ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))'),'ndr'),'hex');
282SELECT 'valid wkt curve polygon 3', encode(ST_AsBinary(ST_GeomFromEWKT('CURVEPOLYGON(CIRCULARSTRING(143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827))'),'ndr'),'hex');
283SELECT 'valid wkt curve polygon 4',
284  encode(ST_AsBinary(ST_GeomFromEWKT('CURVEPOLYGON(CIRCULARSTRING(143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))'),'ndr'),'hex');
285SELECT 'valid wkt curve polygon 5', encode(ST_AsBinary(ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),COMPOUNDCURVE(CIRCULARSTRING(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664), (145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172),CIRCULARSTRING(147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086)))'),'ndr'),'hex');
286SELECT 'invalid wkt curve polygon 4', ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076))');
287SELECT 'invalid wkt curve polygon 5', ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417))');
288SELECT 'invalid wkt curve polygon 6', ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431),(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))');
289SELECT 'invalid wkt curve polygon 7', ST_GeomFromEWKT('CURVEPOLYGON(CIRCULARSTRING(143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 143.62025166838282 -30.037497356076827))');
290SELECT 'invalid wkt curve polygon 8', ST_GeomFromEWKT('CURVEPOLYGON(CIRCULARSTRING(143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431),(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))');
291SELECT 'invalid wkt curve polygon 9', ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),COMPOUNDCURVE(CIRCULARSTRING(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664),CIRCULARSTRING(147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))');
292SELECT 'invalid wkt curve polygon a', ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),COMPOUNDCURVE(CIRCULARSTRING(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664),(145.55230712890625 -33.49203872680664, 147.97080993652344 -32.03618621826172),CIRCULARSTRING(147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -30.76123924022086))');
293SELECT 'invalid wkt curve polygon b', ST_GeomFromEWKT('CURVEPOLYGON((143.62025166838282 -30.037497356076827, 142.92857147299705 -32.75101196874403, 145.96132309891922 -34.985671061528784, 149.57565307617188 -33.41153335571289, 149.41972407584802 -29.824672680573517, 146.1209416055467 -30.19711586270431, 143.62025166838282 -30.037497356076827),COMPOUNDCURVE(CIRCULARSTRING(144.84399355252685 -31.26123924022086, 144.20551952601693 -32.27215644886158, 145.55230712890625 -33.49203872680664),(145.55230712890625 -33.49203872680664),CIRCULARSTRING(147.97080993652344 -32.03618621826172, 146.38697244992585 -31.47406391572417, 144.84399355252685 -31.26123924022086))');
294SELECT 'valid ewkb curve polygon 1', ST_AsEWKT(ST_GeomFromEWKB(decode('010a00000001000000010200000007000000ccdf061ad9f3614054093e6d99093ec0ab9085dbb6dd614081540229216040c0ebd7a828c33e62409bf026782a7e41c0000000c06bb2624000000020adb440c08e632f616ead6240c9f7b0bf1dd33dc09011eec0de4362407dd6672f76323ec0ccdf061ad9f3614054093e6d99093ec0', 'hex')));
295SELECT 'valid ewkb curve polygon 2', ST_AsEWKT(ST_GeomFromEWKB(decode('010a00000002000000010200000007000000ccdf061ad9f3614054093e6d99093ec0ab9085dbb6dd614081540229216040c0ebd7a828c33e62409bf026782a7e41c0000000c06bb2624000000020adb440c08e632f616ead6240c9f7b0bf1dd33dc09011eec0de4362407dd6672f76323ec0ccdf061ad9f3614054093e6d99093ec00102000000060000006844c4fe011b6240342e2993e0423fc0d45daf9d93066240c4a0c305d62240c000000080ac31624000000020fbbe40c0000000e0107f6240000000c0a10440c04e1c0c14624c6240bf3fb6405c793fc06844c4fe011b6240342e2993e0423fc0', 'hex')));
296SELECT 'valid ewkb curve polygon 3', ST_AsEWKT(ST_GeomFromEWKB(decode('010a00000001000000010800000007000000ccdf061ad9f3614054093e6d99093ec0ab9085dbb6dd614081540229216040c0ebd7a828c33e62409bf026782a7e41c0000000c06bb2624000000020adb440c08e632f616ead6240c9f7b0bf1dd33dc09011eec0de4362407dd6672f76323ec0ccdf061ad9f3614054093e6d99093ec0', 'hex')));
297SELECT 'valid ewkb curve polygon 4', ST_AsEWKT(ST_GeomFromEWKB(decode('010a00000002000000010800000007000000ccdf061ad9f3614054093e6d99093ec0ab9085dbb6dd614081540229216040c0ebd7a828c33e62409bf026782a7e41c0000000c06bb2624000000020adb440c08e632f616ead6240c9f7b0bf1dd33dc09011eec0de4362407dd6672f76323ec0ccdf061ad9f3614054093e6d99093ec00102000000060000006844c4fe011b6240342e2993e0423fc0d45daf9d93066240c4a0c305d62240c000000080ac31624000000020fbbe40c0000000e0107f6240000000c0a10440c04e1c0c14624c6240bf3fb6405c793fc06844c4fe011b6240342e2993e0423fc0', 'hex')));
298SELECT 'valid ewkb curve polygon 5', ST_AsEWKT(ST_GeomFromEWKB(decode('010a00000002000000010200000007000000ccdf061ad9f3614054093e6d99093ec0ab9085dbb6dd614081540229216040c0ebd7a828c33e62409bf026782a7e41c0000000c06bb2624000000020adb440c08e632f616ead6240c9f7b0bf1dd33dc09011eec0de4362407dd6672f76323ec0ccdf061ad9f3614054093e6d99093ec00109000000030000000108000000030000006844c4fe011b6240342e2993e0423fc0d45daf9d93066240c4a0c305d62240c000000080ac31624000000020fbbe40c001020000000200000000000080ac31624000000020fbbe40c0000000e0107f6240000000c0a10440c0010800000003000000000000e0107f6240000000c0a10440c04e1c0c14624c6240bf3fb6405c793fc06844c4fe011b6240342e2993e0423fc0', 'hex')));
299SELECT 'valid curve 6', encode(ST_AsBinary(ST_GeomFromText('CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 4 5, 1 4, 0 0)), CIRCULARSTRING(1.7 1, 1.4 0.4, 1.7 1) )'),'ndr'),'hex');
300SELECT 'valid curve 7', encode(ST_AsBinary(ST_GeomFromText('CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 4 5, 1 4, 0 0)), (1.7 1, 1.4 0.4, 1.7 1) )'),'ndr'),'hex');
301SELECT 'valid curve 8', encode(ST_AsBinary(ST_GeomFromText('CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 0 0)), CIRCULARSTRING(1.7 1, 1.4 0.4, 1.7 1) )'),'ndr'),'hex');
302SELECT 'null response', ST_NumPoints(ST_GeomFromEWKT('CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 4 5, 1 4, 0 0)), CIRCULARSTRING(1.7 1, 1.4 0.4, 1.7 1) )'));
303