Debian Codegraph @

mysql-test/suite/gis/r/wkt.result

raw
1 SET @wkt_pt = 'POINT(0 0)';
2 SET @wkt_ln = 'LINESTRING(0 0,2 2,4 4,6 6,8 8, 10 10)';
3 SET @wkt_py = 'POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))';
4 SET @wkt_mpt = 'MULTIPOINT(0 0,2 2,4 4,6 6)';
5 SET @wkt_mln = 'MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))';
6 SET @wkt_mpy = 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),'
7 '((10 10,10 12,12 12,12 10,10 10)))';
8 SET @wkt_gc = 'GEOMETRYCOLLECTION('
9 'POINT(0 0),'
10 'LINESTRING(0 0,10 10),'
11 'POLYGON((0 0,0 10,10 10,10 0, 0 0)),'
12 'MULTIPOINT(0 0,2 2,4 4,6 6,8 8,10 10),'
13 'MULTILINESTRING((0 0,10 10),(0 10,10 0)),'
14 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))';
15 #
16 # Functions that accept a WKT value of any geometry type.
17 #
18 # ST_GeomFromText()
19 SELECT ST_AsText(ST_GeomFromText(@wkt_pt));
20 ST_AsText(ST_GeomFromText(@wkt_pt))
21 POINT(0 0)
22 SELECT ST_AsText(ST_GeomFromText(@wkt_ln));
23 ST_AsText(ST_GeomFromText(@wkt_ln))
24 LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10)
25 SELECT ST_AsText(ST_GeomFromText(@wkt_py));
26 ST_AsText(ST_GeomFromText(@wkt_py))
27 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))
28 SELECT ST_AsText(ST_GeomFromText(@wkt_mpt));
29 ST_AsText(ST_GeomFromText(@wkt_mpt))
30 MULTIPOINT((0 0),(2 2),(4 4),(6 6))
31 SELECT ST_AsText(ST_GeomFromText(@wkt_mln));
32 ST_AsText(ST_GeomFromText(@wkt_mln))
33 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))
34 SELECT ST_AsText(ST_GeomFromText(@wkt_mpy));
35 ST_AsText(ST_GeomFromText(@wkt_mpy))
36 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((10 10,10 12,12 12,12 10,10 10)))
37 SELECT ST_AsText(ST_GeomFromText(@wkt_gc));
38 ST_AsText(ST_GeomFromText(@wkt_gc))
39 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))
40 # ST_GeometryFromText()
41 SELECT ST_AsText(ST_GeometryFromText(@wkt_pt));
42 ST_AsText(ST_GeometryFromText(@wkt_pt))
43 POINT(0 0)
44 SELECT ST_AsText(ST_GeometryFromText(@wkt_ln));
45 ST_AsText(ST_GeometryFromText(@wkt_ln))
46 LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10)
47 SELECT ST_AsText(ST_GeometryFromText(@wkt_py));
48 ST_AsText(ST_GeometryFromText(@wkt_py))
49 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))
50 SELECT ST_AsText(ST_GeometryFromText(@wkt_mpt));
51 ST_AsText(ST_GeometryFromText(@wkt_mpt))
52 MULTIPOINT((0 0),(2 2),(4 4),(6 6))
53 SELECT ST_AsText(ST_GeometryFromText(@wkt_mln));
54 ST_AsText(ST_GeometryFromText(@wkt_mln))
55 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))
56 SELECT ST_AsText(ST_GeometryFromText(@wkt_mpy));
57 ST_AsText(ST_GeometryFromText(@wkt_mpy))
58 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((10 10,10 12,12 12,12 10,10 10)))
59 SELECT ST_AsText(ST_GeometryFromText(@wkt_gc));
60 ST_AsText(ST_GeometryFromText(@wkt_gc))
61 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))
62 #
63 # Function that accepts a WKT value of Point geometry
64 #
65 # ST_PointFromText()
66 SELECT ST_AsText(ST_PointFromText(@wkt_pt));
67 ST_AsText(ST_PointFromText(@wkt_pt))
68 POINT(0 0)
69 #
70 # Functions that accept a WKT value of LineString geometry
71 #
72 # ST_LineFromText()
73 SELECT ST_AsText(ST_LineFromText(@wkt_ln));
74 ST_AsText(ST_LineFromText(@wkt_ln))
75 LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10)
76 # ST_LineStringFromText()
77 SELECT ST_AsText(ST_LineStringFromText(@wkt_ln));
78 ST_AsText(ST_LineStringFromText(@wkt_ln))
79 LINESTRING(0 0,2 2,4 4,6 6,8 8,10 10)
80 #
81 # Functions that accept a WKT value of Polygon geometry
82 #
83 # ST_PolyFromText()
84 SELECT ST_AsText(ST_PolyFromText(@wkt_py));
85 ST_AsText(ST_PolyFromText(@wkt_py))
86 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))
87 # ST_PolygonFromText()
88 SELECT ST_AsText(ST_PolygonFromText(@wkt_py));
89 ST_AsText(ST_PolygonFromText(@wkt_py))
90 POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))
91 #
92 # Functions that accept a WKT value of MultiPoint geometry
93 #
94 # ST_MPointFromText()
95 SELECT ST_AsText(ST_MPointFromText(@wkt_mpt));
96 ST_AsText(ST_MPointFromText(@wkt_mpt))
97 MULTIPOINT((0 0),(2 2),(4 4),(6 6))
98 # ST_MultiPointFromText()
99 SELECT ST_AsText(ST_MultiPointFromText(@wkt_mpt));
100 ST_AsText(ST_MultiPointFromText(@wkt_mpt))
101 MULTIPOINT((0 0),(2 2),(4 4),(6 6))
102 #
103 # Functions that accept a WKT value of MultiLineString geometry
104 #
105 # ST_MLineFromText()
106 SELECT ST_AsText(ST_MLineFromText(@wkt_mln));
107 ST_AsText(ST_MLineFromText(@wkt_mln))
108 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))
109 # ST_MultiLineStringFromText()
110 SELECT ST_AsText(ST_MultiLineStringFromText(@wkt_mln));
111 ST_AsText(ST_MultiLineStringFromText(@wkt_mln))
112 MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))
113 #
114 # Functions that accept a WKT value of MultiPolygon geometry
115 #
116 # ST_MPolyFromText()
117 SELECT ST_AsText(ST_MPolyFromText(@wkt_mpy));
118 ST_AsText(ST_MPolyFromText(@wkt_mpy))
119 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((10 10,10 12,12 12,12 10,10 10)))
120 # ST_MultiPolygonFromText()
121 SELECT ST_AsText(ST_MultiPolygonFromText(@wkt_mpy));
122 ST_AsText(ST_MultiPolygonFromText(@wkt_mpy))
123 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((10 10,10 12,12 12,12 10,10 10)))
124 #
125 # Functions that accept a WKT value of GeometryCollection geometry
126 #
127 # ST_GeomCollFromTxt()
128 SELECT ST_AsText(ST_GeomCollFromTxt(@wkt_gc));
129 ST_AsText(ST_GeomCollFromTxt(@wkt_gc))
130 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))
131 # ST_GeomCollFromText()
132 SELECT ST_AsText(ST_GeomCollFromText(@wkt_gc));
133 ST_AsText(ST_GeomCollFromText(@wkt_gc))
134 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))
135 # ST_GeometryCollectionFromText()
136 SELECT ST_AsText(ST_GeometryCollectionFromText(@wkt_gc));
137 ST_AsText(ST_GeometryCollectionFromText(@wkt_gc))
138 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOINT((0 0),(2 2),(4 4),(6 6),(8 8),(10 10)),MULTILINESTRING((0 0,10 10),(0 10,10 0)),MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))
139 #
140 # Invalid function calls
141 #
142 SELECT ST_GeomFromText();
143 ERROR 42000: Incorrect parameter count in the call to native function 'ST_GeomFromText'
144 SELECT ST_GeomFromText(NULL);
145 ST_GeomFromText(NULL)
146 NULL
147 SELECT ST_GeomFromText('POINT()');
148 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
149 SELECT ST_GeomFromText('LINESTRING(0 0,! 10)');
150 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
151 SELECT ST_GeometryFromText();
152 ERROR 42000: Incorrect parameter count in the call to native function 'ST_GeometryFromText'
153 SELECT ST_GeometryFromText(NULL);
154 ST_GeometryFromText(NULL)
155 NULL
156 SELECT ST_GeometryFromText('POINT(! 0)');
157 ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
158 SELECT ST_GeometryFromText('POLYGON((0 0,0 10,10 10,10 0,0 0)');
159 ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
160 SELECT ST_PointFromText();
161 ERROR 42000: Incorrect parameter count in the call to native function 'ST_PointFromText'
162 SELECT ST_PointFromText(NULL);
163 ST_PointFromText(NULL)
164 NULL
165 SELECT ST_PointFromText('POINT()');
166 ERROR 22023: Invalid GIS data provided to function st_pointfromtext.
167 SELECT ST_LineFromText();
168 ERROR 42000: Incorrect parameter count in the call to native function 'ST_LineFromText'
169 SELECT ST_LineFromText(NULL);
170 ST_LineFromText(NULL)
171 NULL
172 SELECT ST_LineFromText('LINESTRING(a a,b b)');
173 ERROR 22023: Invalid GIS data provided to function st_linefromtext.
174 SELECT ST_LineStringFromText();
175 ERROR 42000: Incorrect parameter count in the call to native function 'ST_LineStringFromText'
176 SELECT ST_LineStringFromText(NULL);
177 ST_LineStringFromText(NULL)
178 NULL
179 SELECT ST_LineStringFromText('LINESTRING(1 1,1 b)');
180 ERROR 22023: Invalid GIS data provided to function st_linestringfromtext.
181 SELECT ST_PolyFromText();
182 ERROR 42000: Incorrect parameter count in the call to native function 'ST_PolyFromText'
183 SELECT ST_PolyFromText(NULL);
184 ST_PolyFromText(NULL)
185 NULL
186 SELECT ST_PolyFromText('POLYGON(())');
187 ERROR 22023: Invalid GIS data provided to function st_polyfromtext.
188 SELECT ST_PolygonFromText();
189 ERROR 42000: Incorrect parameter count in the call to native function 'ST_PolygonFromText'
190 SELECT ST_PolygonFromText(NULL);
191 ST_PolygonFromText(NULL)
192 NULL
193 SELECT ST_PolygonFromText('POLYGON((0 0,0 5,5 5,5 0,0 0),())');
194 ERROR 22023: Invalid GIS data provided to function st_polygonfromtext.
195 SELECT ST_MPointFromText();
196 ERROR 42000: Incorrect parameter count in the call to native function 'ST_MPointFromText'
197 SELECT ST_MPointFromText(NULL);
198 ST_MPointFromText(NULL)
199 NULL
200 SELECT ST_MPointFromText('MULTIPOINT(0 0,1)');
201 ERROR 22023: Invalid GIS data provided to function st_mpointfromtext.
202 SELECT ST_MultiPointFromText();
203 ERROR 42000: Incorrect parameter count in the call to native function 'ST_MultiPointFromText'
204 SELECT ST_MultiPointFromText(NULL);
205 ST_MultiPointFromText(NULL)
206 NULL
207 SELECT ST_MultiPointFromText('MULTIPOINT(0 0,1 1 1)');
208 ERROR 22023: Invalid GIS data provided to function st_multipointfromtext.
209 SELECT ST_MLineFromText();
210 ERROR 42000: Incorrect parameter count in the call to native function 'ST_MLineFromText'
211 SELECT ST_MLineFromText(NULL);
212 ST_MLineFromText(NULL)
213 NULL
214 SELECT ST_MLineFromText('MULTILINESTRING((0 0,1),())');
215 ERROR 22023: Invalid GIS data provided to function st_mlinefromtext.
216 SELECT ST_MultiLineStringFromText();
217 ERROR 42000: Incorrect parameter count in the call to native function 'ST_MultiLineStringFromText'
218 SELECT ST_MultiLineStringFromText(NULL);
219 ST_MultiLineStringFromText(NULL)
220 NULL
221 SELECT ST_MultiLineStringFromText('MULTILINESTRING((0 0,1),(1 1,2 2)');
222 ERROR 22023: Invalid GIS data provided to function st_multilinestringfromtext.
223 SELECT ST_MPolyFromText();
224 ERROR 42000: Incorrect parameter count in the call to native function 'ST_MPolyFromText'
225 SELECT ST_MPolyFromText(NULL);
226 ST_MPolyFromText(NULL)
227 NULL
228 SELECT ST_MPolyFromText('MULTIPOLYGON(((0 0,1)),(()))');
229 ERROR 22023: Invalid GIS data provided to function st_mpolyfromtext.
230 SELECT ST_MultiPolygonFromText();
231 ERROR 42000: Incorrect parameter count in the call to native function 'ST_MultiPolygonFromText'
232 SELECT ST_MultiPolygonFromText(NULL);
233 ST_MultiPolygonFromText(NULL)
234 NULL
235 SELECT ST_MultiPolygonFromText('MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)),(2 2,2 3,3 3,3 2,2 2))');
236 ERROR 22023: Invalid GIS data provided to function st_multipolygonfromtext.
237 SELECT ST_GeomCollFromTxt();
238 ERROR 42000: Incorrect parameter count in the call to native function 'ST_GeomCollFromTxt'
239 SELECT ST_GeomCollFromTxt(NULL);
240 ST_GeomCollFromTxt(NULL)
241 NULL
242 SELECT ST_GeomCollFromTxt('GEOMETRYCOLLECTION(POINT())');
243 ERROR 22023: Invalid GIS data provided to function st_geomcollfromtxt.
244 SELECT ST_GeomCollFromText();
245 ERROR 42000: Incorrect parameter count in the call to native function 'ST_GeomCollFromText'
246 SELECT ST_GeomCollFromText(NULL);
247 ST_GeomCollFromText(NULL)
248 NULL
249 SELECT ST_GeomCollFromText('GEOMETRYCOLLECTION(POINT(a a))');
250 ERROR 22023: Invalid GIS data provided to function st_geomcollfromtext.
251 SELECT ST_GeometryCollectionFromText();
252 ERROR 42000: Incorrect parameter count in the call to native function 'ST_GeometryCollectionFromText'
253 SELECT ST_GeometryCollectionFromText(NULL);
254 ST_GeometryCollectionFromText(NULL)
255 NULL
256 SELECT ST_GeometryCollectionFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,1 1)');
257 ERROR 22023: Invalid GIS data provided to function st_geometrycollectionfromtext.
258 #
259 # WL#8579 Spatial Reference Systems
260 #
261 CREATE PROCEDURE gis_wkt_funcs(IN srid INT)
262 BEGIN
263 SET @wkt_pt = 'POINT(0 0)';
264 SET @wkt_ln = 'LINESTRING(0 0,2 2,4 4,6 6,8 8, 10 10)';
265 SET @wkt_py = 'POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))';
266 SET @wkt_mpt = 'MULTIPOINT(0 0,2 2,4 4,6 6)';
267 SET @wkt_mln = 'MULTILINESTRING((0 0,2 2,4 4),(6 6,8 8,10 10))';
268 SET @wkt_mpy = 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),'
269 '((10 10,10 12,12 12,12 10,10 10)))';
270 SET @wkt_gc = 'GEOMETRYCOLLECTION('
271 'POINT(0 0),'
272 'LINESTRING(0 0,10 10),'
273 'POLYGON((0 0,0 10,10 10,10 0, 0 0)),'
274 'MULTIPOINT(0 0,2 2,4 4,6 6,8 8,10 10),'
275 'MULTILINESTRING((0 0,10 10),(0 10,10 0)),'
276 'MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 10,10 10,10 5,5 5))))';
277 # GIS WKT functions
278 DO ST_GeomFromText(@wkt_pt, srid);
279 DO ST_GeometryFromText(@wkt_pt, srid);
280 DO ST_PointFromText(@wkt_pt, srid);
281 DO ST_LineFromText(@wkt_ln, srid);
282 DO ST_LineStringFromText(@wkt_ln, srid);
283 DO ST_PolyFromText(@wkt_py, srid);
284 DO ST_PolygonFromText(@wkt_py, srid);
285 DO ST_MPointFromText(@wkt_mpt, srid);
286 DO ST_MultiPointFromText(@wkt_mpt, srid);
287 DO ST_MLineFromText(@wkt_mln, srid);
288 DO ST_MultiLineStringFromText(@wkt_mln, srid);
289 DO ST_MPolyFromText(@wkt_mpy, srid);
290 DO ST_MultiPolygonFromText(@wkt_mpy, srid);
291 DO ST_GeomCollFromTxt(@wkt_gc, srid);
292 DO ST_GeomCollFromText(@wkt_gc, srid);
293 DO ST_GeometryCollectionFromText(@wkt_gc, srid);
294 END |
295 # SRID 0 (should pass)
296 CALL gis_wkt_funcs(0);
297 # Projected SRS (should pass)
298 CALL gis_wkt_funcs(2000);
299 # Geographic SRS (should pass)
300 CALL gis_wkt_funcs(4326);
301 # Undefined SRS (should fail)
302 CALL gis_wkt_funcs(19000000);
303 ERROR SR001: There's no spatial reference system with SRID 19000000.
304 # Clean up
305 DROP PROCEDURE gis_wkt_funcs;
306 #
307 # Bug #23632147 MYSQL USES INVALID WKT FOR EMPTY GEOMETRYCOLLECTION
308 #
309 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POINT EMPTY'));
310 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
311 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POINT()'));
312 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
313 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' POINT EMPTY '));
314 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
315 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POINT EMPTY()'));
316 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
317 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POINT EMPT'));
318 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
319 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POINT EMPTYNESS'));
320 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
321 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('LINESTRING EMPTY'));
322 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
323 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('LINESTRING()'));
324 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
325 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' LINESTRING EMPTY '));
326 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
327 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('LINESTRING EMPTY()'));
328 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
329 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('LINESTRING EMPT'));
330 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
331 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('LINESTRING EMPTYNESS'));
332 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
333 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POLYGON EMPTY'));
334 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
335 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POLYGON()'));
336 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
337 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' POLYGON EMPTY '));
338 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
339 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POLYGON EMPTY()'));
340 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
341 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POLYGON EMPT'));
342 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
343 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('POLYGON EMPTYNESS'));
344 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
345 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOINT EMPTY'));
346 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
347 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOINT()'));
348 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
349 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' MULTIPOINT EMPTY '));
350 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
351 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOINT EMPTY()'));
352 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
353 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOINT EMPT'));
354 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
355 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOINT EMPTYNESS'));
356 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
357 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTILINESTRING EMPTY'));
358 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
359 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTILINESTRING()'));
360 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
361 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' MULTILINESTRING EMPTY '));
362 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
363 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTILINESTRING EMPTY()'));
364 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
365 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTILINESTRING EMPT'));
366 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
367 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTILINESTRING EMPTYNESS'));
368 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
369 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOLYGON EMPTY'));
370 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
371 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOLYGON()'));
372 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
373 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' MULTIPOLYGON EMPTY '));
374 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
375 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOLYGON EMPTY()'));
376 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
377 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOLYGON EMPT'));
378 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
379 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('MULTIPOLYGON EMPTYNESS'));
380 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
381 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPTY'));
382 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPTY'))
383 GEOMETRYCOLLECTION EMPTY
384 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
385 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))
386 GEOMETRYCOLLECTION EMPTY
387 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(' GEOMETRYCOLLECTION EMPTY '));
388 ST_ASTEXT(ST_GEOMFROMTEXT(' GEOMETRYCOLLECTION EMPTY '))
389 GEOMETRYCOLLECTION EMPTY
390 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPTY()'));
391 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
392 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPT'));
393 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
394 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION EMPTYNESS'));
395 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
396 SELECT ST_ASTEXT(ST_GEOMFROMTEXT(
397 'GEOMETRYCOLLECTION(
398 GEOMETRYCOLLECTION(
399 GEOMETRYCOLLECTION EMPTY,
400 GEOMETRYCOLLECTION ()
401 )
402 )'
403 ));
404 ST_ASTEXT(ST_GEOMFROMTEXT(
405 'GEOMETRYCOLLECTION(
406 GEOMETRYCOLLECTION(
407 GEOMETRYCOLLECTION EMPTY,
408 GEOMETRYCOLLECTION ()
409 )
410 )'
411 ))
412 GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION EMPTY,GEOMETRYCOLLECTION EMPTY))
413 ########################################################################
414 # Inserting testing SRS values in spatial reference table
415 ########################################################################
416 # Inserting geographical srs with long-lat ordering
417 CREATE SPATIAL REFERENCE SYSTEM 30000000 NAME 'TEST30000000' DEFINITION 'GEOGCS["SIRGAS 1995",DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6170"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["LONG",EAST],AXIS["LAT",NORTH],AUTHORITY["EPSG","30000000"]]';
418 # Inserting geographical srs with lat-long ordering
419 CREATE SPATIAL REFERENCE SYSTEM 30100000 NAME 'TEST30100000' DEFINITION 'GEOGCS["SIRGAS 1995",DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6170"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["LAT",NORTH],AXIS["LONG",EAST],AUTHORITY["EPSG","30100000"]]';
420 # Inserting projected srs with northing-easting ordering
421 CREATE SPATIAL REFERENCE SYSTEM 30200000 NAME 'TEST30200000' DEFINITION 'PROJCS["NAD83(NSRS2007) / Virginia Lambert",GEOGCS["NAD83(NSRS2007)",DATUM["NAD83 (National Spatial Reference System 2007)",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6759"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4759"]],PROJECTION["Lambert Conic Conformal (2SP)",AUTHORITY["EPSG","9802"]],PARAMETER["Latitude of false origin",36,AUTHORITY["EPSG","8821"]],PARAMETER["Longitude of false origin",-79.5,AUTHORITY["EPSG","8822"]],PARAMETER["Latitude of 1st standard parallel",37,AUTHORITY["EPSG","8823"]],PARAMETER["Latitude of 2nd standard parallel",39.5,AUTHORITY["EPSG","8824"]],PARAMETER["Easting at false origin",0,AUTHORITY["EPSG","8826"]],PARAMETER["Northing at false origin",0,AUTHORITY["EPSG","8827"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",NORTH],AXIS["Y",EAST],AUTHORITY["EPSG","30200000"]]';
422 # Inserting projected srs with easting-northing ordering
423 CREATE SPATIAL REFERENCE SYSTEM 30300000 NAME 'TEST30300000' DEFINITION 'PROJCS["NAD83(NSRS2007) / Virginia Lambert",GEOGCS["NAD83(NSRS2007)",DATUM["NAD83 (National Spatial Reference System 2007)",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6759"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4759"]],PROJECTION["Lambert Conic Conformal (2SP)",AUTHORITY["EPSG","9802"]],PARAMETER["Latitude of false origin",36,AUTHORITY["EPSG","8821"]],PARAMETER["Longitude of false origin",-79.5,AUTHORITY["EPSG","8822"]],PARAMETER["Latitude of 1st standard parallel",37,AUTHORITY["EPSG","8823"]],PARAMETER["Latitude of 2nd standard parallel",39.5,AUTHORITY["EPSG","8824"]],PARAMETER["Easting at false origin",0,AUTHORITY["EPSG","8826"]],PARAMETER["Northing at false origin",0,AUTHORITY["EPSG","8827"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","30300000"]]';
424 ########################################################################
425 # Retrieving geometrycollections with the ST_GEOMCOLLFROMTEXT function
426 #
427 ########################################################################
428 # Retrieve values with long lat ordering.
429 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
430 POLYGON((0 0,10 0,10 10,0 10,0 0)),
431 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
432 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'));
433 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
434 POLYGON((0 0,10 0,10 10,0 10,0 0)),
435 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
436 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'))
437 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
438 # Retrieve values with lat-long ordering.
439 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
440 POLYGON((0 0,0 10,10 10,10 0,0 0)),
441 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
442 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'));
443 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
444 POLYGON((0 0,0 10,10 10,10 0,0 0)),
445 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
446 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'))
447 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
448 # Retrieve values with SRID-defined ordering.
449 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
450 POLYGON((0 0,0 10,10 10,10 0,0 0)),
451 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
452 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'));
453 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
454 POLYGON((0 0,0 10,10 10,10 0,0 0)),
455 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
456 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'))
457 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
458 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
459 POLYGON((0 0,10 0,10 10,0 10,0 0)),
460 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
461 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'));
462 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
463 POLYGON((0 0,10 0,10 10,0 10,0 0)),
464 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
465 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'))
466 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
467 ########################################################################
468 # Retrieving geometrycollections with the ST_GEOMCOLLFROMTXT function
469 #
470 ########################################################################
471 # Retrieve values with long lat ordering.
472 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
473 POLYGON((0 0,10 0,10 10,0 10,0 0)),
474 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
475 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'));
476 ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
477 POLYGON((0 0,10 0,10 10,0 10,0 0)),
478 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
479 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'))
480 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
481 # Retrieve values with lat-long ordering.
482 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
483 POLYGON((0 0,0 10,10 10,10 0,0 0)),
484 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
485 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'));
486 ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
487 POLYGON((0 0,0 10,10 10,10 0,0 0)),
488 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
489 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'))
490 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
491 # Retrieve values with SRID-defined ordering.
492 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
493 POLYGON((0 0,0 10,10 10,10 0,0 0)),
494 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
495 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'));
496 ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
497 POLYGON((0 0,0 10,10 10,10 0,0 0)),
498 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
499 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'))
500 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
501 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
502 POLYGON((0 0,10 0,10 10,0 10,0 0)),
503 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
504 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'));
505 ST_ASTEXT(ST_GEOMCOLLFROMTXT('GEOMETRYCOLLECTION(POINT(3 5),
506 POLYGON((0 0,10 0,10 10,0 10,0 0)),
507 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
508 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'))
509 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
510 ########################################################################
511 # Retrieving geometrycollections with the ST_GEOMETRYCOLLECTIONFROMTEXT
512 # function
513 ########################################################################
514 # Retrieve values with long lat ordering.
515 SELECT ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
516 POLYGON((0 0,10 0,10 10,0 10,0 0)),
517 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
518 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'));
519 ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
520 POLYGON((0 0,10 0,10 10,0 10,0 0)),
521 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
522 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'))
523 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
524 # Retrieve values with lat-long ordering.
525 SELECT ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
526 POLYGON((0 0,0 10,10 10,10 0,0 0)),
527 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
528 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'));
529 ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
530 POLYGON((0 0,0 10,10 10,10 0,0 0)),
531 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
532 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'))
533 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
534 # Retrieve values with SRID-defined ordering.
535 SELECT ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
536 POLYGON((0 0,0 10,10 10,10 0,0 0)),
537 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
538 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'));
539 ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
540 POLYGON((0 0,0 10,10 10,10 0,0 0)),
541 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
542 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'))
543 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
544 SELECT ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
545 POLYGON((0 0,10 0,10 10,0 10,0 0)),
546 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
547 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'));
548 ST_ASTEXT(ST_GEOMETRYCOLLECTIONFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
549 POLYGON((0 0,10 0,10 10,0 10,0 0)),
550 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
551 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'))
552 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
553 ########################################################################
554 # Retrieving geometrycollections with the ST_GEOMETRYFROMTEXT function
555 #
556 ########################################################################
557 # Retrieve values with long lat ordering.
558 SELECT ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
559 POLYGON((0 0,10 0,10 10,0 10,0 0)),
560 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
561 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'));
562 ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
563 POLYGON((0 0,10 0,10 10,0 10,0 0)),
564 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
565 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'))
566 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
567 # Retrieve values with lat-long ordering.
568 SELECT ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
569 POLYGON((0 0,0 10,10 10,10 0,0 0)),
570 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
571 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'));
572 ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
573 POLYGON((0 0,0 10,10 10,10 0,0 0)),
574 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
575 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'))
576 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
577 # Retrieve values with SRID-defined ordering.
578 SELECT ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
579 POLYGON((0 0,0 10,10 10,10 0,0 0)),
580 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
581 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'));
582 ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
583 POLYGON((0 0,0 10,10 10,10 0,0 0)),
584 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
585 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'))
586 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
587 SELECT ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
588 POLYGON((0 0,10 0,10 10,0 10,0 0)),
589 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
590 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'));
591 ST_ASTEXT(ST_GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
592 POLYGON((0 0,10 0,10 10,0 10,0 0)),
593 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
594 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'))
595 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
596 ########################################################################
597 # Retrieving geometrycollections with the ST_GEOMFROMTEXT function
598 #
599 ########################################################################
600 # Retrieve values with long lat ordering.
601 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
602 POLYGON((0 0,10 0,10 10,0 10,0 0)),
603 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
604 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'));
605 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
606 POLYGON((0 0,10 0,10 10,0 10,0 0)),
607 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
608 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=long-lat'))
609 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
610 # Retrieve values with lat-long ordering.
611 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
612 POLYGON((0 0,0 10,10 10,10 0,0 0)),
613 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
614 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'));
615 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
616 POLYGON((0 0,0 10,10 10,10 0,0 0)),
617 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
618 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-long'))
619 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
620 # Retrieve values with SRID-defined ordering.
621 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
622 POLYGON((0 0,0 10,10 10,10 0,0 0)),
623 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
624 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'));
625 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
626 POLYGON((0 0,0 10,10 10,10 0,0 0)),
627 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
628 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=srid-defined'))
629 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
630 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
631 POLYGON((0 0,10 0,10 10,0 10,0 0)),
632 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
633 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'));
634 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
635 POLYGON((0 0,10 0,10 10,0 10,0 0)),
636 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
637 ((0 0,-2 -2,0 -2, 0 0))))', 30300000,'axis-order=srid-defined'))
638 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
639 ########################################################################
640 # Retrieving linestrings with the ST_LINEFROMTEXT function
641 #
642 ########################################################################
643 # Retrieve values with long lat ordering.
644 SELECT ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
645 'axis-order=long-lat'));
646 ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
647 'axis-order=long-lat'))
648 LINESTRING(5 0,10 5,15 10)
649 # Retrieve values with lat-long ordering.
650 SELECT ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
651 'axis-order=lat-long'));
652 ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
653 'axis-order=lat-long'))
654 LINESTRING(0 5,5 10,10 15)
655 # Retrieve values with SRID-defined ordering.
656 SELECT ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
657 'axis-order=srid-defined'));
658 ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
659 'axis-order=srid-defined'))
660 LINESTRING(0 5,5 10,10 15)
661 SELECT ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30000000,
662 'axis-order=srid-defined'));
663 ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30000000,
664 'axis-order=srid-defined'))
665 LINESTRING(0 5,5 10,10 15)
666 ########################################################################
667 # Retrieving linestrings with the ST_LINESTRINGFROMTEXT function
668 #
669 ########################################################################
670 # Retrieve values with long lat ordering.
671 SELECT ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
672 'axis-order=long-lat'));
673 ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
674 'axis-order=long-lat'))
675 LINESTRING(5 0,10 5,15 10)
676 # Retrieve values with lat-long ordering.
677 SELECT ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
678 'axis-order=lat-long'));
679 ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
680 'axis-order=lat-long'))
681 LINESTRING(0 5,5 10,10 15)
682 # Retrieve values with SRID-defined ordering.
683 SELECT ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
684 'axis-order=srid-defined'));
685 ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30100000,
686 'axis-order=srid-defined'))
687 LINESTRING(0 5,5 10,10 15)
688 SELECT ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30000000,
689 'axis-order=srid-defined'));
690 ST_ASTEXT(ST_LINESTRINGFROMTEXT('LINESTRING(0 5,5 10,10 15)', 30000000,
691 'axis-order=srid-defined'))
692 LINESTRING(0 5,5 10,10 15)
693 ########################################################################
694 # Retrieving multistrings with the ST_MLINEFROMTEXT function
695 #
696 ########################################################################
697 # Retrieve values with long lat ordering.
698 SELECT ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
699 (8 11,11 14,14 17))', 30000000,'axis-order=long-lat'));
700 ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
701 (8 11,11 14,14 17))', 30000000,'axis-order=long-lat'))
702 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
703 # Retrieve values with lat-long ordering.
704 SELECT ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
705 (8 11,11 14,14 17))', 30100000,'axis-order=lat-long'));
706 ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
707 (8 11,11 14,14 17))', 30100000,'axis-order=lat-long'))
708 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
709 # Retrieve values with SRID-defined ordering.
710 SELECT ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
711 (8 11,11 14,14 17))', 30200000,'axis-order=srid-defined'));
712 ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
713 (8 11,11 14,14 17))', 30200000,'axis-order=srid-defined'))
714 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
715 SELECT ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
716 (8 11,11 14,14 17))', 30300000,'axis-order=srid-defined'));
717 ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
718 (8 11,11 14,14 17))', 30300000,'axis-order=srid-defined'))
719 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
720 ########################################################################
721 # Retrieving multipoints with the ST_MPOINTFROMTEXT function
722 #
723 ########################################################################
724 # Retrieve values with long lat ordering.
725 SELECT ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
726 30000000,'axis-order=long-lat'));
727 ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
728 30000000,'axis-order=long-lat'))
729 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
730 # Retrieve values with lat-long ordering.
731 SELECT ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
732 30100000,'axis-order=lat-long'));
733 ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
734 30100000,'axis-order=lat-long'))
735 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
736 # Retrieve values with SRID-defined ordering.
737 SELECT ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
738 30200000,'axis-order=srid-defined'));
739 ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
740 30200000,'axis-order=srid-defined'))
741 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
742 SELECT ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
743 30300000,'axis-order=srid-defined'));
744 ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',
745 30300000,'axis-order=srid-defined'))
746 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
747 ########################################################################
748 # Retrieving multipolygons with the ST_MPOLYFROMTEXT function
749 #
750 ########################################################################
751 # Retrieve values with long lat ordering.
752 SELECT ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),
753 (4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))', 30000000,
754 'axis-order=long-lat'));
755 ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),
756 (4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))', 30000000,
757 'axis-order=long-lat'))
758 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
759 # Retrieve values with lat-long ordering.
760 SELECT ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),
761 (4 4,6 4,6 6,4 6, 4 4)),((0 0,-2 -2,-2 0, 0 0)))', 30100000,
762 'axis-order=lat-long'));
763 ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),
764 (4 4,6 4,6 6,4 6, 4 4)),((0 0,-2 -2,-2 0, 0 0)))', 30100000,
765 'axis-order=lat-long'))
766 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0)))
767 # Retrieve values with SRID-defined ordering.
768 SELECT ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),
769 (4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))', 30200000,
770 'axis-order=srid-defined'));
771 ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),
772 (4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))', 30200000,
773 'axis-order=srid-defined'))
774 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
775 SELECT ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),
776 (4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))', 30300000,
777 'axis-order=srid-defined'));
778 ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),
779 (4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))', 30300000,
780 'axis-order=srid-defined'))
781 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
782 ########################################################################
783 # Retrieving multistrings with the ST_MULTILINESTRINGFROMTEXT function
784 #
785 ########################################################################
786 # Retrieve values with long lat ordering.
787 SELECT ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
788 (8 11,11 14,14 17))', 30000000,'axis-order=long-lat'));
789 ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
790 (8 11,11 14,14 17))', 30000000,'axis-order=long-lat'))
791 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
792 # Retrieve values with lat-long ordering.
793 SELECT ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
794 (8 11,11 14,14 17))', 30100000,'axis-order=lat-long'));
795 ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
796 (8 11,11 14,14 17))', 30100000,'axis-order=lat-long'))
797 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
798 # Retrieve values with SRID-defined ordering.
799 SELECT ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
800 (8 11,11 14,14 17))', 30200000,'axis-order=srid-defined'));
801 ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
802 (8 11,11 14,14 17))', 30200000,'axis-order=srid-defined'))
803 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
804 SELECT ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
805 (8 11,11 14,14 17))', 30300000,'axis-order=srid-defined'));
806 ST_ASTEXT(ST_MULTILINESTRINGFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),
807 (8 11,11 14,14 17))', 30300000,'axis-order=srid-defined'))
808 MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))
809 ########################################################################
810 # Retrieving multipoints with the ST_MULTIPOINTFROMTEXT function
811 #
812 ########################################################################
813 # Retrieve values with long lat ordering.
814 SELECT ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
815 (4 9))', 30000000,'axis-order=long-lat'));
816 ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
817 (4 9))', 30000000,'axis-order=long-lat'))
818 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
819 # Retrieve values with lat-long ordering.
820 SELECT ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
821 (4 9))', 30100000,'axis-order=lat-long'));
822 ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
823 (4 9))', 30100000,'axis-order=lat-long'))
824 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
825 # Retrieve values with SRID-defined ordering.
826 SELECT ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
827 (4 9))', 30200000,'axis-order=srid-defined'));
828 ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
829 (4 9))', 30200000,'axis-order=srid-defined'))
830 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
831 SELECT ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
832 (4 9))', 30300000,'axis-order=srid-defined'));
833 ST_ASTEXT(ST_MULTIPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2),
834 (4 9))', 30300000,'axis-order=srid-defined'))
835 MULTIPOINT((0 2),(5 7),(8 2),(4 9))
836 ########################################################################
837 # Retrieving multipolygons with the ST_MULTIPOLYGONFROMTEXT function
838 #
839 ########################################################################
840 # Retrieve values with long lat ordering.
841 SELECT ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
842 'MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0), (4 4,4 6,6 6,6 4, 4 4)),
843 ((0 0,-2 -2,0 -2, 0 0)))', 30000000, 'axis-order=long-lat'));
844 ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
845 'MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0), (4 4,4 6,6 6,6 4, 4 4)),
846 ((0 0,-2 -2,0 -2, 0 0)))', 30000000, 'axis-order=long-lat'))
847 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
848 # Retrieve values with lat-long ordering.
849 SELECT ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
850 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0), (4 4,6 4,6 6,4 6, 4 4)),
851 ((0 0,-2 -2,-2 0, 0 0)))', 30100000, 'axis-order=lat-long'));
852 ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
853 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0), (4 4,6 4,6 6,4 6, 4 4)),
854 ((0 0,-2 -2,-2 0, 0 0)))', 30100000, 'axis-order=lat-long'))
855 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0)))
856 # Retrieve values with SRID-defined ordering.
857 SELECT ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
858 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0), (4 4,4 6,6 6,6 4, 4 4)),
859 ((0 0,-2 -2,0 -2, 0 0)))', 30200000, 'axis-order=srid-defined'));
860 ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
861 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0), (4 4,4 6,6 6,6 4, 4 4)),
862 ((0 0,-2 -2,0 -2, 0 0)))', 30200000, 'axis-order=srid-defined'))
863 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
864 SELECT ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
865 'MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0), (4 4,4 6,6 6,6 4, 4 4)),
866 ((0 0,-2 -2,0 -2, 0 0)))', 30300000, 'axis-order=srid-defined'));
867 ST_ASTEXT(ST_MULTIPOLYGONFROMTEXT(
868 'MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0), (4 4,4 6,6 6,6 4, 4 4)),
869 ((0 0,-2 -2,0 -2, 0 0)))', 30300000, 'axis-order=srid-defined'))
870 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
871 ########################################################################
872 # Retrieving points with the ST_POINTFROMTEXT function
873 #
874 ########################################################################
875 # When the geometry is in a projected spatial reference system,
876 # the coordinates are interpreted as in the order they appear in the geometry.
877 # Retrieve values with long lat ordering.
878 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30300000, 'axis-order=long-lat'));
879 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30300000, 'axis-order=long-lat'))
880 POINT(1 2)
881 # Retrieve values with lat-long ordering.
882 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30100000, 'axis-order=lat-long'));
883 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30100000, 'axis-order=lat-long'))
884 POINT(1 2)
885 # Retrieve values with SRID-defined ordering.
886 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30200000, 'axis-order=srid-defined'));
887 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30200000, 'axis-order=srid-defined'))
888 POINT(1 2)
889 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30100000, 'axis-order=srid-defined'));
890 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)',30100000, 'axis-order=srid-defined'))
891 POINT(1 2)
892 ########################################################################
893 # Retrieving polygons with the ST_POLYFROMTEXT function
894 #
895 ########################################################################
896 # Retrieve values with long lat ordering.
897 SELECT ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30000000,
898 'axis-order=long-lat'));
899 ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30000000,
900 'axis-order=long-lat'))
901 POLYGON((0 0,5 0,5 5,0 5,0 0))
902 # Retrieve values with lat-long ordering.
903 SELECT ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30100000,
904 'axis-order=lat-long'));
905 ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30100000,
906 'axis-order=lat-long'))
907 POLYGON((0 0,0 5,5 5,5 0,0 0))
908 # Retrieve values with SRID-defined ordering.
909 SELECT ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30200000,
910 'axis-order=srid-defined'));
911 ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30200000,
912 'axis-order=srid-defined'))
913 POLYGON((0 0,0 5,5 5,5 0,0 0))
914 SELECT ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30300000,
915 'axis-order=srid-defined'));
916 ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30300000,
917 'axis-order=srid-defined'))
918 POLYGON((0 0,5 0,5 5,0 5,0 0))
919 ########################################################################
920 # Retrieving polygons with the ST_POLYGONFROMTEXT function
921 #
922 ########################################################################
923 # Retrieve values with long lat ordering.
924 SELECT ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30000000,
925 'axis-order=long-lat'));
926 ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30000000,
927 'axis-order=long-lat'))
928 POLYGON((0 0,5 0,5 5,0 5,0 0))
929 # Retrieve values with lat-long ordering.
930 SELECT ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30100000,
931 'axis-order=lat-long'));
932 ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30100000,
933 'axis-order=lat-long'))
934 POLYGON((0 0,0 5,5 5,5 0,0 0))
935 # Retrieve values with SRID-defined ordering.
936 SELECT ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30200000,
937 'axis-order=srid-defined'));
938 ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))', 30200000,
939 'axis-order=srid-defined'))
940 POLYGON((0 0,0 5,5 5,5 0,0 0))
941 SELECT ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30300000,
942 'axis-order=srid-defined'));
943 ST_ASTEXT(ST_POLYGONFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))', 30300000,
944 'axis-order=srid-defined'))
945 POLYGON((0 0,5 0,5 5,0 5,0 0))
946 # ######################################################################
947 # Options upper and lower case testing
948 # ######################################################################
949 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
950 POLYGON((0 0,10 0,10 10,0 10,0 0)),
951 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
952 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=Long-Lat'));
953 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
954 POLYGON((0 0,10 0,10 10,0 10,0 0)),
955 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
956 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,'axis-order=Long-Lat'))
957 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
958 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
959 POLYGON((0 0,0 10,10 10,10 0,0 0)),
960 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
961 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axiS-Order=Lat-lonG'));
962 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
963 POLYGON((0 0,0 10,10 10,10 0,0 0)),
964 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
965 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axiS-Order=Lat-lonG'))
966 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
967 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
968 POLYGON((0 0,0 10,10 10,10 0,0 0)),
969 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
970 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'AXis-orDer=srid-defined'));
971 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
972 POLYGON((0 0,0 10,10 10,10 0,0 0)),
973 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
974 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'AXis-orDer=srid-defined'))
975 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
976 ########################################################################
977 # Error testing
978 ########################################################################
979 # Test with too many options.
980 SELECT ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),
981 (4 4,6 4,6 6,4 6, 4 4)),((0 0,-2 -2,-2 0, 0 0)))', 30300000,
982 'axis-order=srid-defined, axis-order=lat-long'));
983 ERROR 22023: Duplicate option key 'axis-order' in funtion 'st_mpolyfromtext'.
984 # Test with invalid options key.
985 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
986 POLYGON((0 0,0 10,10 10,10 0,0 0)),
987 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
988 ((0 0,-2 -2,-2 0, 0 0))))', 30300000,'axix-order=srid-defined'));
989 ERROR 22023: Invalid option key 'axix-order' in function st_geomcollfromtext.
990 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
991 POLYGON((0 0,0 10,10 10,10 0,0 0)),
992 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
993 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axix-order=lat-long'));
994 ERROR 22023: Invalid option key 'axix-order' in function st_geomcollfromtext.
995 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
996 POLYGON((0 0,0 10,10 10,10 0,0 0)),
997 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
998 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axix-order=lat-long'));
999 ERROR 22023: Invalid option key 'axix-order' in function st_geomcollfromtext.
1000 # Test with invalid options value
1001 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1002 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1003 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1004 ((0 0,-2 -2,-2 0, 0 0))))', 30300000,'axis-order=srid-dfined'));
1005 ERROR 22023: Invalid value 'srid-dfined' for option 'axis-order' in function 'st_geomcollfromtext'.
1006 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1007 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1008 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1009 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,'axis-order=lat-bong'));
1010 ERROR 22023: Invalid value 'lat-bong' for option 'axis-order' in function 'st_geomcollfromtext'.
1011 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1012 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1013 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1014 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=lat-shwong'));
1015 ERROR 22023: Invalid value 'lat-shwong' for option 'axis-order' in function 'st_geomcollfromtext'.
1016 # Test with both invalid option and invalid value
1017 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1018 POLYGON((0 0,10 0,10 10,0 10,0 0)),
1019 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
1020 ((0 0,-2 -2,0 -2, 0 0))))', 30100000,'axis-border=lat-shwong'));
1021 ERROR 22023: Invalid option key 'axis-border' in function st_geomcollfromtext.
1022 # Testing for badly formed options argument.
1023 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1024 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1025 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1026 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order srid-defined'));
1027 ERROR 22023: The string 'axis-order srid-defined' is not a valid key = value pair in function st_geomcollfromtext.
1028 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1029 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1030 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1031 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'=axis-order srid-defined'));
1032 ERROR 22023: The options argument in function st_geomcollfromtext starts with the invalid character '='.
1033 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1034 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1035 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1036 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order=srid-defined='));
1037 ERROR 22023: The options argument in function st_geomcollfromtext ends with the invalid character '='.
1038 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1039 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1040 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1041 ((0 0,-2 -2,-2 0, 0 0))))', 30100000,'axis-order== srid-defined'));
1042 ERROR 22023: The options argument in function st_geomcollfromtext contains the invalid character sequence '=='.
1043 # ######################################################################
1044 # Empty string and white space testing
1045 # ######################################################################
1046 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1047 POLYGON((0 0,10 0,10 10,0 10,0 0)),
1048 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
1049 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,''));
1050 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1051 POLYGON((0 0,10 0,10 10,0 10,0 0)),
1052 MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),
1053 ((0 0,-2 -2,0 -2, 0 0))))', 30000000,''))
1054 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
1055 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1056 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1057 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1058 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,' '));
1059 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1060 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1061 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1062 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,' '))
1063 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
1064 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1065 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1066 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1067 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,' axis-order = srid-defined '));
1068 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5),
1069 POLYGON((0 0,0 10,10 10,10 0,0 0)),
1070 MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6, 4 4)),
1071 ((0 0,-2 -2,-2 0, 0 0))))', 30200000,' axis-order = srid-defined '))
1072 GEOMETRYCOLLECTION(POINT(3 5),POLYGON((0 0,0 10,10 10,10 0,0 0)),MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4)),((0 0,-2 -2,-2 0,0 0))))
1073 # ######################################################################
1074 # NULL value testing
1075 # ######################################################################
1076 # NULL value testing: Should return NULL if either or both parameters is NULL
1077 SELECT ST_ASTEXT(ST_POINTFROMTEXT(NULL,30300000, 'axis-order=long-lat'));
1078 ST_ASTEXT(ST_POINTFROMTEXT(NULL,30300000, 'axis-order=long-lat'))
1079 NULL
1080 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)', NULL, 'axis-order=lat-long'));
1081 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)', NULL, 'axis-order=lat-long'))
1082 NULL
1083 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)', 30200000, NULL));
1084 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)', 30200000, NULL))
1085 NULL
1086 SELECT ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)', NULL, NULL));
1087 ST_ASTEXT(ST_POINTFROMTEXT('point(1 2)', NULL, NULL))
1088 NULL
1089 SELECT ST_ASTEXT(ST_POINTFROMTEXT(NULL, NULL, NULL));
1090 ST_ASTEXT(ST_POINTFROMTEXT(NULL, NULL, NULL))
1091 NULL
1092 #
1093 # Bug #25818451 ASAN HEAP-USE-AFTER-FREE WITH GEOMETRY + STRING
1094 #
1095 SET @c:=REPEAT('a',128);
1096 SET @f:=0x336f;
1097 SET @s:=REPLACE("DO ST_ASTEXT(LEFT(@c,@f));","'",'"');
1098 PREPARE s FROM @s;
1099 EXECUTE s;
1100 ERROR 22023: Invalid GIS data provided to function st_astext.
1101 DROP PREPARE s;
1102 ##########################################################
1103 # Inserting testing SRS values in spatial reference table
1104 ##########################################################
1105 # Inserting geographical srs with long-lat ordering
1106 CREATE SPATIAL REFERENCE SYSTEM 32000000 NAME 'TEST32000000' DEFINITION 'GEOGCS["SIRGAS 1995",DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6170"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["LONG",EAST],AXIS["LAT",NORTH],AUTHORITY["EPSG","32000000"]]';
1107 # Inserting geographical srs with lat-long ordering
1108 CREATE SPATIAL REFERENCE SYSTEM 32100000 NAME 'TEST32100000' DEFINITION 'GEOGCS["SIRGAS 1995",DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6170"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["LAT",NORTH],AXIS["LONG",EAST],AUTHORITY["EPSG","32100000"]]';
1109 # Inserting projected srs with northing-easting ordering
1110 CREATE SPATIAL REFERENCE SYSTEM 32200000 NAME 'TEST32200000' DEFINITION 'PROJCS["NAD83(NSRS2007) / Virginia Lambert",GEOGCS["NAD83(NSRS2007)",DATUM["NAD83 (National Spatial Reference System 2007)",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6759"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4759"]],PROJECTION["Lambert Conic Conformal (2SP)",AUTHORITY["EPSG","9802"]],PARAMETER["Latitude of false origin",36,AUTHORITY["EPSG","8821"]],PARAMETER["Longitude of false origin",-79.5,AUTHORITY["EPSG","8822"]],PARAMETER["Latitude of 1st standard parallel",37,AUTHORITY["EPSG","8823"]],PARAMETER["Latitude of 2nd standard parallel",39.5,AUTHORITY["EPSG","8824"]],PARAMETER["Easting at false origin",0,AUTHORITY["EPSG","8826"]],PARAMETER["Northing at false origin",0,AUTHORITY["EPSG","8827"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",NORTH],AXIS["Y",EAST],AUTHORITY["EPSG","32200000"]]';
1111 #########################################################################
1112 # Test with geometries with geographic SRS with long-lat ordering outside
1113 # valid range.
1114 #########################################################################
1115 SELECT ST_POINTFROMTEXT('POINT(-200 10)',32000000);
1116 ERROR 22S02: Longitude -200.000000 is out of range in function st_pointfromtext. It must be within (-180.000000, 180.000000].
1117 SELECT ST_LINEFROMTEXT('LINESTRING(0 5,194 10,10 15)',32000000);
1118 ERROR 22S02: Longitude 194.000000 is out of range in function st_linefromtext. It must be within (-180.000000, 180.000000].
1119 SELECT ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,-300 5,0 0))',32000000);
1120 ERROR 22S02: Longitude -300.000000 is out of range in function st_polyfromtext. It must be within (-180.000000, 180.000000].
1121 SELECT ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (798 2), (-344 9))',32000000);
1122 ERROR 22S02: Longitude 798.000000 is out of range in function st_mpointfromtext. It must be within (-180.000000, 180.000000].
1123 SELECT ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(744 11,11 14,14 17))',32000000);
1124 ERROR 22S02: Longitude 744.000000 is out of range in function st_mlinefromtext. It must be within (-180.000000, 180.000000].
1125 SELECT ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,350 0,350 350,0 350,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',32000000);
1126 ERROR 22S02: Longitude 350.000000 is out of range in function st_mpolyfromtext. It must be within (-180.000000, 180.000000].
1127 SELECT ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(-199 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',32000000);
1128 ERROR 22S02: Longitude -199.000000 is out of range in function st_geomcollfromtext. It must be within (-180.000000, 180.000000].
1129 #########################################################################
1130 # Test with geometries with geographic SRS with lat-long ordering outside
1131 # valid range (same geometries as above, but with different error since
1132 # coordinates are flipped).
1133 #########################################################################
1134 SELECT ST_POINTFROMTEXT('POINT(-200 10)',32100000);
1135 ERROR 22S03: Latitude -200.000000 is out of range in function st_pointfromtext. It must be within [-90.000000, 90.000000].
1136 SELECT ST_LINEFROMTEXT('LINESTRING(0 5,194 10,10 15)',32100000);
1137 ERROR 22S03: Latitude 194.000000 is out of range in function st_linefromtext. It must be within [-90.000000, 90.000000].
1138 SELECT ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,-300 5,0 0))',32100000);
1139 ERROR 22S03: Latitude -300.000000 is out of range in function st_polyfromtext. It must be within [-90.000000, 90.000000].
1140 SELECT ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (798 2), (4 9))',32100000);
1141 ERROR 22S03: Latitude 798.000000 is out of range in function st_mpointfromtext. It must be within [-90.000000, 90.000000].
1142 SELECT ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(744 11,11 14,14 17))',32100000);
1143 ERROR 22S03: Latitude 744.000000 is out of range in function st_mlinefromtext. It must be within [-90.000000, 90.000000].
1144 SELECT ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,350 0,350 350,0 350,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',32100000);
1145 ERROR 22S03: Latitude 350.000000 is out of range in function st_mpolyfromtext. It must be within [-90.000000, 90.000000].
1146 SELECT ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(-199 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',32100000);
1147 ERROR 22S03: Latitude -199.000000 is out of range in function st_geomcollfromtext. It must be within [-90.000000, 90.000000].
1148 ##############################
1149 # Miscellaneous error testing
1150 ##############################
1151 SELECT ST_POINTFROMTEXT('POINT(-91 10)',32100000);
1152 ERROR 22S03: Latitude -91.000000 is out of range in function st_pointfromtext. It must be within [-90.000000, 90.000000].
1153 SELECT ST_POINTFROMTEXT('POINT(10 -182)',32100000);
1154 ERROR 22S02: Longitude -182.000000 is out of range in function st_pointfromtext. It must be within (-180.000000, 180.000000].
1155 SELECT ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(744 11,11 91,14 17))',32000000);
1156 ERROR 22S02: Longitude 744.000000 is out of range in function st_mlinefromtext. It must be within (-180.000000, 180.000000].
1157 SELECT ST_MLINEFROMTEXT('MULTILINESTRING((0 95,2 4,4 6),(744 11,11 91,14 17))',32000000);
1158 ERROR 22S03: Latitude 95.000000 is out of range in function st_mlinefromtext. It must be within [-90.000000, 90.000000].
1159 ###################
1160 # Edge case testing
1161 ###################
1162 SELECT ST_ASTEXT(ST_POINTFROMTEXT('POINT(-90.0000000 10)',32100000));
1163 ST_ASTEXT(ST_POINTFROMTEXT('POINT(-90.0000000 10)',32100000))
1164 POINT(-90 10)
1165 SELECT ST_ASTEXT(ST_POINTFROMTEXT('POINT(10 -180.000000)',32100000));
1166 ST_ASTEXT(ST_POINTFROMTEXT('POINT(10 -180.000000)',32100000))
1167 POINT(10 -180)
1168 SELECT ST_ASTEXT(ST_POINTFROMTEXT('POINT(90.0000000 10)',32100000));
1169 ST_ASTEXT(ST_POINTFROMTEXT('POINT(90.0000000 10)',32100000))
1170 POINT(90 10)
1171 SELECT ST_ASTEXT(ST_POINTFROMTEXT('POINT(10 180.000000)',32100000));
1172 ST_ASTEXT(ST_POINTFROMTEXT('POINT(10 180.000000)',32100000))
1173 POINT(10 180)
1174 SELECT ST_POINTFROMTEXT('POINT(-90.0000001 10)',32100000);
1175 ERROR 22S03: Latitude -90.000000 is out of range in function st_pointfromtext. It must be within [-90.000000, 90.000000].
1176 SELECT ST_POINTFROMTEXT('POINT(10 -180.0000001)',32100000);
1177 ERROR 22S02: Longitude -180.000000 is out of range in function st_pointfromtext. It must be within (-180.000000, 180.000000].
1178 SELECT ST_POINTFROMTEXT('POINT(90.0000001 10)',32100000);
1179 ERROR 22S03: Latitude 90.000000 is out of range in function st_pointfromtext. It must be within [-90.000000, 90.000000].
1180 SELECT ST_POINTFROMTEXT('POINT(10 180.0000001)',32100000);
1181 ERROR 22S02: Longitude 180.000000 is out of range in function st_pointfromtext. It must be within (-180.000000, 180.000000].
1182 #################################################################
1183 # Test that range restriction does not apply to projected spatial
1184 # reference systems
1185 #################################################################
1186 SELECT ST_ASTEXT(ST_POINTFROMTEXT('POINT(-200 10)',32200000));
1187 ST_ASTEXT(ST_POINTFROMTEXT('POINT(-200 10)',32200000))
1188 POINT(-200 10)
1189 SELECT ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,194 10,10 15)',32200000));
1190 ST_ASTEXT(ST_LINEFROMTEXT('LINESTRING(0 5,194 10,10 15)',32200000))
1191 LINESTRING(0 5,194 10,10 15)
1192 SELECT ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,-300 5,0 0))',32200000));
1193 ST_ASTEXT(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,-300 5,0 0))',32200000))
1194 POLYGON((0 0,5 0,5 5,-300 5,0 0))
1195 SELECT ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (798 2), (4 9))',32200000));
1196 ST_ASTEXT(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (798 2), (4 9))',32200000))
1197 MULTIPOINT((0 2),(5 7),(798 2),(4 9))
1198 SELECT ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(744 11,11 14,14 17))',32200000));
1199 ST_ASTEXT(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(744 11,11 14,14 17))',32200000))
1200 MULTILINESTRING((0 2,2 4,4 6),(744 11,11 14,14 17))
1201 SELECT ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,350 0,350 350,0 350,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',32200000));
1202 ST_ASTEXT(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,350 0,350 350,0 350,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',32200000))
1203 MULTIPOLYGON(((0 0,350 0,350 350,0 350,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0)))
1204 SELECT ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(-199 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',32200000));
1205 ST_ASTEXT(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(-199 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',32200000))
1206 GEOMETRYCOLLECTION(POINT(-199 5),POLYGON((0 0,10 0,10 10,0 10,0 0)),MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)),((0 0,-2 -2,0 -2,0 0))))
1207 ########################################################
1208 # Test with empty GEOMETRYCOLLECTION with geographic SRS
1209 ########################################################
1210 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()', 32000000));
1211 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()', 32000000))
1212 GEOMETRYCOLLECTION EMPTY
1213 SELECT ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()', 32100000));
1214 ST_ASTEXT(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()', 32100000))
1215 GEOMETRYCOLLECTION EMPTY
1216 DROP SPATIAL REFERENCE SYSTEM 30000000;
1217 DROP SPATIAL REFERENCE SYSTEM 30100000;
1218 DROP SPATIAL REFERENCE SYSTEM 30200000;
1219 DROP SPATIAL REFERENCE SYSTEM 30300000;
1220 DROP SPATIAL REFERENCE SYSTEM 32000000;
1221 DROP SPATIAL REFERENCE SYSTEM 32100000;
1222 DROP SPATIAL REFERENCE SYSTEM 32200000;
1223 #
1224 # WL#11096 Don't do Cartesian computations on geographic geometries
1225 #
1226 # Assume SRID 10 is not defined. Should raise warning.
1227 DO ST_ASTEXT(x'0A000000010100000000000000000000000000000000000000');
1228 Warnings:
1229 Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
1230 DO ST_ASWKT(x'0A000000010100000000000000000000000000000000000000');
1231 Warnings:
1232 Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
1233 #
1234 # Bug #27427677 SIG 11 IN STRING::APPEND() METHOD,
1235 # SQL-COMMON/SQL_STRING.CC:535
1236 #
1237 CREATE TABLE t1(c1 GEOMETRY);
1238 INSERT INTO t1 VALUES (ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0))'));
1239 SELECT ST_AsText(c1) AS f1 FROM t1 ORDER BY f1;
1240 f1
1241 GEOMETRYCOLLECTION(POINT(0 0))
1242 DROP TABLE t1;