Debian Codegraph @

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

raw
1 # Creating geometry objects and parameters.
2 USE test;
3 CREATE TABLE gis_geometries (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
4 # INSERT into table
5 INSERT INTO gis_geometries VALUES
6 (119,ST_GEOMFROMTEXT('POINT(0 179)', 4326)),
7 (120,ST_GEOMFROMTEXT('POINT(0 -179)', 4326));
8 # Checking the integrity of above create/insert statements
9 # 2 rows.
10 SELECT count(ST_ASTEXT(g) != 'NULL') FROM gis_geometries;
11 count(ST_ASTEXT(g) != 'NULL')
12 2
13 SET @pt_lat_minus_91 = x'E6100000010100000000000000000000000000000000C056C0';
14 SET @pt_lat_plus_91 = x'E6100000010100000000000000000000000000000000C05640';
15 SET @pt_long_minus_181 = x'E610000001010000000000000000A066C00000000000000000';
16 SET @pt_long_plus_181 = x'E610000001010000000000000000A066400000000000000000';
17 SET @p_square = ST_BUFFER_STRATEGY('point_square');
18 SET @p_circle = ST_BUFFER_STRATEGY('point_circle', 42);
19 SET @e_flat = ST_BUFFER_STRATEGY('end_flat');
20 SET @e_round = ST_BUFFER_STRATEGY('end_round', 42);
21 SET @j_miter = ST_BUFFER_STRATEGY('join_miter', 3.3);
22 SET @j_round = ST_BUFFER_STRATEGY('join_round', 42);
23 SET @geo_pt = ST_GEOMFROMTEXT('POINT(0 0)', 4326);
24 SET @cart_pt = ST_GEOMFROMTEXT('POINT(0 0)');
25 SET @cart_ls = ST_GEOMFROMTEXT('LINESTRING(0 0, 1 1, 2 0)');
26 SET @cart_py = ST_GEOMFROMTEXT('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))');
27 SET @cart_mpt = ST_GEOMFROMTEXT('MULTIPOINT((0 0), (2 2))');
28 SET @cart_mls = ST_GEOMFROMTEXT('MULTILINESTRING((0 0, 1 1, 2 0), (3 0, 4 1, 5 0))');
29 SET @cart_mpy = ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)), ((3 0, 3 1, 4 1, 4 0, 3 0)))');
30 SET @cart_gc = ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0, 1 1, 2 0), POLYGON((0 0, 0 1, 1 1, 1 0, 0 0)))');
31 #####################################################################################
32 # ST_BUFFER(geometry, distance, [strategy1, strategy2, strategy3])
33 #####################################################################################
34 SELECT ST_ASTEXT(ST_BUFFER(@cart_pt, 2, ST_BUFFER_STRATEGY('point_square')));
35 ST_ASTEXT(ST_BUFFER(@cart_pt, 2, ST_BUFFER_STRATEGY('point_square')))
36 POLYGON((-2 -2,2 -2,2 2,-2 2,-2 -2))
37 SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POINT(0 0)'), 2, @p_square));
38 ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POINT(0 0)'), 2, @p_square))
39 POLYGON((-2 -2,2 -2,2 2,-2 2,-2 -2))
40 SELECT ST_ASTEXT(ST_BUFFER(g, 200000)) FROM gis_geometries WHERE fid=119;
41 ST_ASTEXT(ST_BUFFER(g, 200000))
42 POLYGON((1.808732012132 179.001797223319,1.774319790048 178.651146270628,1.671703263552 178.313926070286,1.504835706186 178.003112171801,1.280142356871 177.730651561997,1.006269248335 177.507002685328,0.693747172682 177.340737607074,0.354584968899 177.238220226374,0.001808440257 177.203370329483,-0.351037520274 177.237519652159,-0.690405373542 177.339363233902,-1.003261471999 177.505007084359,-1.277584215986 177.728111162577,-1.502825601244 178.000124412105,-1.67031857023 178.310605716248,-1.773613842393 178.647621023172,-1.808732012132 178.998202776681,-1.774319790048 179.348853729372,-1.671703263552 179.686073929714,-1.504835706186 179.996887828199,-1.280142356871 -179.730651561998,-1.006269248335 -179.507002685328,-0.693747172682 -179.340737607075,-0.354584968899 -179.238220226374,-0.001808440257 -179.203370329484,0.351037520274 -179.237519652159,0.690405373542 -179.339363233902,1.003261471999 -179.505007084359,1.277584215986 -179.728111162577,1.502825601244 179.999875587896,1.67031857023 179.689394283752,1.773613842393 179.352378976829,1.808732012132 179.001797223319))
43 SELECT ST_ASTEXT(ST_BUFFER(g, 200000)) FROM gis_geometries WHERE fid=120;
44 ST_ASTEXT(ST_BUFFER(g, 200000))
45 POLYGON((1.808732012132 -178.998202776681,1.774319790048 -179.348853729372,1.671703263552 -179.686073929714,1.504835706186 -179.996887828199,1.280142356871 179.730651561998,1.006269248335 179.507002685328,0.693747172682 179.340737607075,0.354584968899 179.238220226374,0.001808440257 179.203370329484,-0.351037520274 179.237519652159,-0.690405373542 179.339363233902,-1.003261471999 179.505007084359,-1.277584215986 179.728111162577,-1.502825601244 -179.999875587896,-1.67031857023 -179.689394283752,-1.773613842393 -179.352378976829,-1.808732012132 -179.001797223319,-1.774319790048 -178.651146270628,-1.671703263552 -178.313926070286,-1.504835706186 -178.003112171801,-1.280142356871 -177.730651561997,-1.006269248335 -177.507002685328,-0.693747172682 -177.340737607074,-0.354584968899 -177.238220226374,-0.001808440257 -177.203370329483,0.351037520274 -177.237519652159,0.690405373542 -177.339363233902,1.003261471999 -177.505007084359,1.277584215986 -177.728111162577,1.502825601244 -178.000124412105,1.67031857023 -178.310605716248,1.773613842393 -178.647621023172,1.808732012132 -178.998202776681))
46 DROP TABLE gis_geometries;
47 #####################################################################################
48 # Invalid function calls
49 #####################################################################################
50 SELECT ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 20));
51 ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 20))
52 GEOMETRYCOLLECTION EMPTY
53 SELECT ST_ASTEXT(ST_BUFFER(NULL, 1));
54 ST_ASTEXT(ST_BUFFER(NULL, 1))
55 NULL
56 DO ST_ASTEXT(ST_BUFFER(@cart_pt, 1, @e_flat));
57 ERROR HY000: Incorrect arguments to st_buffer
58 DO ST_ASTEXT(ST_BUFFER(@cart_pt, 1, @j_round));
59 ERROR HY000: Incorrect arguments to st_buffer
60 DO ST_ASTEXT(ST_BUFFER(@cart_pt, -1));
61 ERROR HY000: Incorrect arguments to st_buffer
62 DO ST_ASTEXT(ST_BUFFER(@cart_ls, 2, @p_square));
63 ERROR HY000: Incorrect arguments to st_buffer
64 DO ST_ASTEXT(ST_BUFFER(@cart_ls, -2));
65 ERROR HY000: Incorrect arguments to st_buffer
66 DO ST_ASTEXT(ST_BUFFER(@cart_py, 3, @p_square));
67 ERROR HY000: Incorrect arguments to st_buffer
68 DO ST_ASTEXT(ST_BUFFER(@cart_py, 3, @e_flat));
69 ERROR HY000: Incorrect arguments to st_buffer
70 DO ST_ASTEXT(ST_BUFFER(@cart_mpt, 4, @e_flat));
71 ERROR HY000: Incorrect arguments to st_buffer
72 DO ST_ASTEXT(ST_BUFFER(@cart_mpt, 4, @j_round));
73 ERROR HY000: Incorrect arguments to st_buffer
74 DO ST_ASTEXT(ST_BUFFER(@cart_mpt, -4));
75 ERROR HY000: Incorrect arguments to st_buffer
76 DO ST_ASTEXT(ST_BUFFER(@cart_mls, 5, @p_square));
77 ERROR HY000: Incorrect arguments to st_buffer
78 DO ST_ASTEXT(ST_BUFFER(@cart_mls, -5));
79 ERROR HY000: Incorrect arguments to st_buffer
80 DO ST_ASTEXT(ST_BUFFER(@cart_mpy, 6, @p_square));
81 ERROR HY000: Incorrect arguments to st_buffer
82 DO ST_ASTEXT(ST_BUFFER(@cart_mpy, 6, @e_flat));
83 ERROR HY000: Incorrect arguments to st_buffer
84 DO ST_ASTEXT(ST_BUFFER(@cart_gc, -7));
85 ERROR HY000: Incorrect arguments to st_buffer
86 DO ST_ASTEXT(ST_BUFFER(@geo_pt, 2000, @p_square));
87 ERROR HY000: Incorrect arguments to st_buffer
88 DO ST_ASTEXT(ST_BUFFER(@geo_pt, 2000, @e_flat));
89 ERROR HY000: Incorrect arguments to st_buffer
90 DO ST_ASTEXT(ST_BUFFER(@geo_pt, 2000, @j_round));
91 ERROR HY000: Incorrect arguments to st_buffer
92 DO ST_ASTEXT(ST_BUFFER(@geo_pt, -2000));
93 ERROR HY000: Incorrect arguments to st_buffer
94 DO ST_ASTEXT(ST_BUFFER(@cart_pt, 1, @p_square, @p_circle));
95 ERROR HY000: Incorrect arguments to st_buffer
96 DO ST_ASTEXT(ST_BUFFER(@cart_pt, 1, @p_circle, @p_square));
97 ERROR HY000: Incorrect arguments to st_buffer
98 DO ST_ASTEXT(ST_BUFFER(@cart_ls, 2, @e_flat, @e_round));
99 ERROR HY000: Incorrect arguments to st_buffer
100 DO ST_ASTEXT(ST_BUFFER(@cart_ls, 2, @e_round, @e_flat));
101 ERROR HY000: Incorrect arguments to st_buffer
102 DO ST_ASTEXT(ST_BUFFER(@cart_py, 2, @j_miter, @j_round));
103 ERROR HY000: Incorrect arguments to st_buffer
104 DO ST_ASTEXT(ST_BUFFER(@cart_py, 2, @j_round, @j_miter));
105 ERROR HY000: Incorrect arguments to st_buffer
106 DO ST_ASTEXT(ST_BUFFER(@cart_pt, 2, 2));
107 ERROR HY000: Incorrect arguments to st_buffer
108 DO ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1));
109 ERROR 22023: Invalid GIS data provided to function st_geomfromtext.
110 DO ST_ASTEXT(ST_BUFFER(ST_GEOMFROMTEXT('LINESTRING(0 0, 2 0, 2 2, 2 0, 1 1)', 4326), 100));
111 ERROR 22S00: st_buffer(LINESTRING) has not been implemented for geographic spatial reference systems.
112 DO ST_BUFFER(@pt_lat_minus_91, 20000);
113 ERROR 22S03: A parameter of function st_buffer contains a geometry with latitude -91.000000, which is out of range. It must be within [-90.000000, 90.000000].
114 DO ST_BUFFER(@pt_lat_plus_91, 20000);
115 ERROR 22S03: A parameter of function st_buffer contains a geometry with latitude 91.000000, which is out of range. It must be within [-90.000000, 90.000000].
116 DO ST_BUFFER(@pt_long_minus_181, 20000);
117 ERROR 22S02: A parameter of function st_buffer contains a geometry with longitude -181.000000, which is out of range. It must be within (-180.000000, 180.000000].
118 DO ST_BUFFER(@pt_long_plus_181, 20000);
119 ERROR 22S02: A parameter of function st_buffer contains a geometry with longitude 181.000000, which is out of range. It must be within (-180.000000, 180.000000].
120 # Assume SRID 10 is not defined.
121 DO ST_BUFFER(x'0A000000010100000000000000000000000000000000000000', 10);
122 ERROR SR001: There's no spatial reference system with SRID 10.