config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/gis/r/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/gis/r/spatial_utility_function_distance_sphere.result

# Creating the spatial Geometry object
USE test;
CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
SET @star_elem_vertical= 'POLYGON((5 0,15 25,25 0,15 5,5 0))';
SET @star_elem_horizontal= 'POLYGON((25 0,0 15,30 15,22 10,25 0))';
SET @star_center= 'POINT(15 10)';
SET @star_top= 'POINT(15 25)';
SET @star_bottom_left= 'POINT(5 0)';
SET @star_bottom_right= 'POINT(25 0)';
SET @star_bottom_points= 'MULTIPOINT(5 0,25 0)';
SET @star_all_points= 'MULTIPOINT(5 0,25 0,15 10,15 25)';
SET @star_line_horizontal= 'LINESTRING(10 15,20 15)';
SET @star_line_vertical= 'LINESTRING(15 5,15 25)';
SET @star_top_to_center= 'LINESTRING(15 25,15 10)';
SET @star_lines_near_horizontal= 'MULTILINESTRING((25 0,0 15,15 30,0 5))';
SET @star_lines_near_vertical= 'MULTILINESTRING((0 5,15 25,0 25))';
SET @star= 'POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))';
SET @star_of_elems='MULTIPOLYGON(((5 0,15 25,25 0,15 5,5 0)),((25 0,0 15,30 15,22 10,25 0)))';
SET @star_collection_elems='GEOMETRYCOLLECTION(MULTIPOLYGON(((5 0,15 25,25 0,15 5,5 0)),((25 0,0 15,30 15,22 10,25 0))),POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0)),LINESTRING(15 25,15 10),MULTIPOINT(5 0,25 0),POINT(15 25))';
SET @star_collection_multilinestr='GEOMETRYCOLLECTION(MULTIPOLYGON(((5 0,15 25,25 0,15 5,5 0)),((25 0,0 15,30 15,22 10,25 0))),POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0)),MULTILINESTRING((25 0,0 15,15 30,0 5)),LINESTRING(15 25,15 10),MULTIPOINT(5 0,25 0),POINT(15 25))';
#INSERT base star
INSERT INTO gis_geometrycollection VALUES
(100,ST_GEOMFROMTEXT(@star)),
(101,ST_GEOMFROMTEXT(@star_elem_vertical)),
(102,ST_GEOMFROMTEXT(@star_elem_horizontal)),
(103,ST_GEOMFROMTEXT(@star_of_elems)),
(104,ST_GEOMFROMTEXT(@star_top)),
(105,ST_GEOMFROMTEXT(@star_center)),
(106,ST_GEOMFROMTEXT(@star_bottom_left)),
(107,ST_GEOMFROMTEXT(@star_bottom_right)),
(108,ST_GEOMFROMTEXT(@star_bottom_points)),
(109,ST_GEOMFROMTEXT(@star_all_points)),
(110,ST_GEOMFROMTEXT(@star_line_horizontal)),
(111,ST_GEOMFROMTEXT(@star_line_vertical)),
(112,ST_GEOMFROMTEXT(@star_top_to_center)),
(113,ST_GEOMFROMTEXT(@star_lines_near_horizontal)),
(114,ST_GEOMFROMTEXT(@star_lines_near_vertical)),
(115,ST_GEOMFROMTEXT(@star_collection_elems)),
(116,ST_GEOMFROMTEXT(@star_collection_multilinestr));
# Checking the integrity of the above create/insert statements 
# 17 rows. 
SELECT count(ST_ASTEXT(g) != 'NULL') FROM gis_geometrycollection;
count(ST_ASTEXT(g) != 'NULL')
17
#####################################################################################
# ST_DISTANCE_SPHERE(point, point)
#####################################################################################
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 0)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 0)'))
20015042.813723423
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 0)'))
19903848.13142
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 -90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 -90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 -90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'))
157249.0357231545
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0.0000 -0.000)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(0.0000 -0.000)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 1)'))
157249.0357231545
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 -1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(1 -1)'))
157249.0357231545
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-1 1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-1 1)'))
157249.0357231545
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-1 -1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-1 -1)'))
157249.0357231545
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(90 45)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(90 45)'))
10007521.406861713
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(90 -45)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(90 -45)'))
10007521.406861713
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-90 45)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-90 45)'))
10007521.406861713
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-90 -45)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('POINT(-90 -45)'))
10007521.406861713
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(180 90)'), ST_GEOMFROMTEXT('POINT(180 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(180 90)'), ST_GEOMFROMTEXT('POINT(180 90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(180 -90)'), ST_GEOMFROMTEXT('POINT(180 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(180 -90)'), ST_GEOMFROMTEXT('POINT(180 -90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.999 -90)'), ST_GEOMFROMTEXT('POINT(-179.999 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.999 -90)'), ST_GEOMFROMTEXT('POINT(-179.999 -90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.999 -89.999)'), ST_GEOMFROMTEXT('POINT(-179.999 -89.999)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.999 -89.999)'), ST_GEOMFROMTEXT('POINT(-179.999 -89.999)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.9 90)'), ST_GEOMFROMTEXT('POINT(-179.99 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.9 90)'), ST_GEOMFROMTEXT('POINT(-179.99 90)'))
0.000000000000613
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.9 -90)'), ST_GEOMFROMTEXT('POINT(-179.9999 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-179.9 -90)'), ST_GEOMFROMTEXT('POINT(-179.9999 -90)'))
0.00000000000068
#####################################################################################
# ST_DISTANCE_SPHERE(point, multipoint)
#####################################################################################
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0)'))
20015042.813723423
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(-179 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(-179 0)'))
19903848.13142
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 1,2 2)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 1,2 2)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0,180 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0,180 90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 90,0 0,-179 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 90,0 0,-179 -90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 1)'))
111194.68229846345
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 1,1 0,1 1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 1,1 0,1 1)'))
111194.68229846345
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(180 90)'), ST_GEOMFROMTEXT('MULTIPOINT(180 -90,-179 90,-179 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(180 90)'), ST_GEOMFROMTEXT('MULTIPOINT(180 -90,-179 90,-179 -90)'))
0.00000000000681
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(37 -42)'), ST_GEOMFROMTEXT('MULTIPOINT(57 32)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(37 -42)'), ST_GEOMFROMTEXT('MULTIPOINT(57 32)'))
8478959.246920772
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-85 48)'), ST_GEOMFROMTEXT('MULTIPOINT(159 -49)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-85 48)'), ST_GEOMFROMTEXT('MULTIPOINT(159 -49)'))
15442376.75883719
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(168 -21)'), ST_GEOMFROMTEXT('MULTIPOINT(-22 -32)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(168 -21)'), ST_GEOMFROMTEXT('MULTIPOINT(-22 -32)'))
14026307.891828652
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-64 67)'), ST_GEOMFROMTEXT('MULTIPOINT(-103 45,155 57,-166 85)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-64 67)'), ST_GEOMFROMTEXT('MULTIPOINT(-103 45,155 57,-166 85)'))
2724877.06508
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-36 -41)'), ST_GEOMFROMTEXT('MULTIPOINT(-37 45,-49 23,97 -19)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-36 -41)'), ST_GEOMFROMTEXT('MULTIPOINT(-37 45,-49 23,97 -19)'))
7242075.616184488
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(138 86)'), ST_GEOMFROMTEXT('MULTIPOINT(15 -79,-110 -76,49 31)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(138 86)'), ST_GEOMFROMTEXT('MULTIPOINT(15 -79,-110 -76,49 31)'))
6562054.981740507
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(164 -41)'), ST_GEOMFROMTEXT('MULTIPOINT(-11 2,-81 3,161 62,-119 31)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(164 -41)'), ST_GEOMFROMTEXT('MULTIPOINT(-11 2,-81 3,161 62,-119 31)'))
11240807.17994
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-106 -23)'), ST_GEOMFROMTEXT('MULTIPOINT(-152 72,89 -3,-23 -42,126 59)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-106 -23)'), ST_GEOMFROMTEXT('MULTIPOINT(-152 72,89 -3,-23 -42,126 59)'))
7764654.2944
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(168 -15)'), ST_GEOMFROMTEXT('MULTIPOINT(68 73,157 -55,-178 -29,46 78,-133 59,180 59)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(168 -15)'), ST_GEOMFROMTEXT('MULTIPOINT(68 73,157 -55,-178 -29,46 78,-133 59,180 59)'))
2118904.21786
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(106 76)'), ST_GEOMFROMTEXT('MULTIPOINT(53 20,148 -40,-61 -90,170 -37,-64 -82,-167 85)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(106 76)'), ST_GEOMFROMTEXT('MULTIPOINT(53 20,148 -40,-61 -90,170 -37,-64 -82,-167 85)'))
1623498.34154
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-50 36)'), ST_GEOMFROMTEXT('MULTIPOINT(-32 -64,-116 -35,148 89,-75 16,-99 87,-51 -2,-113 24,93 46,168 53)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-50 36)'), ST_GEOMFROMTEXT('MULTIPOINT(-32 -64,-116 -35,148 89,-75 16,-99 87,-51 -2,-113 24,93 46,168 53)'))
3325569.686282281
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-139 54)'), ST_GEOMFROMTEXT('MULTIPOINT(151 -57,-74 61,10 28,170 -47,97 -45,-5 -82,121 -21,-96 -44,81 -68)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(-139 54)'), ST_GEOMFROMTEXT('MULTIPOINT(151 -57,-74 61,10 28,170 -47,97 -45,-5 -82,121 -21,-96 -44,81 -68)'))
3792274.55936
#####################################################################################
# ST_DISTANCE_SPHERE(multipoint, point)
#####################################################################################
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 0)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(180 0)'))
20015042.813723423
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(0 90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('POINT(-179 0)'))
19903848.13142
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 1,2 2)'), ST_GEOMFROMTEXT('POINT(0 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 1,2 2)'), ST_GEOMFROMTEXT('POINT(0 0)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(180 90,0 0,180 -90)'), ST_GEOMFROMTEXT('POINT(-0 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(180 90,0 0,180 -90)'), ST_GEOMFROMTEXT('POINT(-0 0)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-179 90,0 0,-179 -90)'), ST_GEOMFROMTEXT('POINT(-179 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-179 90,0 0,-179 -90)'), ST_GEOMFROMTEXT('POINT(-179 0)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-179 90,0 0,-179 -90)'), ST_GEOMFROMTEXT('POINT(-179 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-179 90,0 0,-179 -90)'), ST_GEOMFROMTEXT('POINT(-179 -90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-172 -70)'), ST_GEOMFROMTEXT('POINT(45 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-172 -70)'), ST_GEOMFROMTEXT('POINT(45 90)'))
17791149.16775415
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-157 -67)'), ST_GEOMFROMTEXT('POINT(-92 -88)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-157 -67)'), ST_GEOMFROMTEXT('POINT(-92 -88)'))
2471277.694448198
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(156 -64,-96 57,-15 -18)'), ST_GEOMFROMTEXT('POINT(-73 -1)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(156 -64,-96 57,-15 -18)'), ST_GEOMFROMTEXT('POINT(-73 -1)'))
6603053.68396362
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-110 43,-79 -82,-32 24)'), ST_GEOMFROMTEXT('POINT(61 27)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-110 43,-79 -82,-32 24)'), ST_GEOMFROMTEXT('POINT(61 27)'))
9099422.923953956
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-85 87,-155 48,-163 -84)'), ST_GEOMFROMTEXT('POINT(-95 84)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-85 87,-155 48,-163 -84)'), ST_GEOMFROMTEXT('POINT(-95 84)'))
343552.51114
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(33 -49,174 -25,-4 -56)'), ST_GEOMFROMTEXT('POINT(48 46)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(33 -49,174 -25,-4 -56)'), ST_GEOMFROMTEXT('POINT(48 46)'))
10662878.71627671
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-36 -87,-75 20,-157 78)'), ST_GEOMFROMTEXT('POINT(-165 18)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-36 -87,-75 20,-157 78)'), ST_GEOMFROMTEXT('POINT(-165 18)'))
6685828.523608761
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(151 17,-150 -43,-165 76,87 53)'), ST_GEOMFROMTEXT('POINT(152 27)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(151 17,-150 -43,-165 76,87 53)'), ST_GEOMFROMTEXT('POINT(152 27)'))
1116698.095391192
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-159 -88,-177 -82,17 76,79 1)'), ST_GEOMFROMTEXT('POINT(35 -74)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-159 -88,-177 -82,17 76,79 1)'), ST_GEOMFROMTEXT('POINT(35 -74)'))
1995604.718606601
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-130 -20,-118 -63,-57 0)'), ST_GEOMFROMTEXT('POINT(-156 89)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-130 -20,-118 -63,-57 0)'), ST_GEOMFROMTEXT('POINT(-156 89)'))
10024915.226003662
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-84 25,-52 53,125 -50,-171 51,55 -13,-4 -69)'), ST_GEOMFROMTEXT('POINT(-127 52)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-84 25,-52 53,125 -50,-171 51,55 -13,-4 -69)'), ST_GEOMFROMTEXT('POINT(-127 52)'))
3000854.92226
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(56 -45,158 84,112 2,85 21,88 89,-151 33,-158 40)'), ST_GEOMFROMTEXT('POINT(-172 87)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(56 -45,158 84,112 2,85 21,88 89,-151 33,-158 40)'), ST_GEOMFROMTEXT('POINT(-172 87)'))
369477.73572
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-6 -56,-73 54,20 -74,-160 72,-4 42,-120 -62,-54 -8,-85 48,159 -49,100 -75)'),
ST_GEOMFROMTEXT('POINT(167 -17)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-6 -56,-73 54,20 -74,-160 72,-4 42,-120 -62,-54 -8,-85 48,159 -49,100 -75)'),
ST_GEOMFROMTEXT('POINT(167 -17)'))
3630973.4329214436
#####################################################################################
# ST_DISTANCE_SPHERE(multipoint, multipoint)
#####################################################################################
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 0)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0)'))
20015042.813723423
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(0 90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(-179 0)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(-179 0)'))
19903848.13142
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 1,2 2)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,0 0,2 2)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 1,2 2)'), ST_GEOMFROMTEXT('MULTIPOINT(1 1,0 0,2 2)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(180 90,0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(180 90,0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(180 0,0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0,0 90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(180 0,0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0,0 90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-179 90,0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(-179 0,0 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-179 90,0 0)'), ST_GEOMFROMTEXT('MULTIPOINT(-179 0,0 -90)'))
10007521.40686
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(111 11,11 1)'), ST_GEOMFROMTEXT('MULTIPOINT(1 11,11 11)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(111 11,11 1)'), ST_GEOMFROMTEXT('MULTIPOINT(1 11,11 11)'))
1111946.8229846344
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(10 10,20 20,30 30)'), ST_GEOMFROMTEXT('MULTIPOINT(15 15,20 20,25 25)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(10 10,20 20,30 30)'), ST_GEOMFROMTEXT('MULTIPOINT(15 15,20 20,25 25)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-10 -10,-20 -20,-30 -30)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0,-30 -30,180 -90)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-10 -10,-20 -20,-30 -30)'), ST_GEOMFROMTEXT('MULTIPOINT(180 0,-30 -30,180 -90)'))
0
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-150 -79)'), ST_GEOMFROMTEXT('MULTIPOINT(145 -2)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-150 -79)'), ST_GEOMFROMTEXT('MULTIPOINT(145 -2)'))
9274204.820691504
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(164 -37)'), ST_GEOMFROMTEXT('MULTIPOINT(67 59)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(164 -37)'), ST_GEOMFROMTEXT('MULTIPOINT(67 59)'))
13840477.43111
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(135 62)'), ST_GEOMFROMTEXT('MULTIPOINT(-116 -22)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(135 62)'), ST_GEOMFROMTEXT('MULTIPOINT(-116 -22)'))
13142652.165808784
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-123 85)'), ST_GEOMFROMTEXT('MULTIPOINT(-54 -40)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-123 85)'), ST_GEOMFROMTEXT('MULTIPOINT(-54 -40)'))
14239014.67884
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(152 43)'), ST_GEOMFROMTEXT('MULTIPOINT(106 76,53 20,148 -40)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(152 43)'), ST_GEOMFROMTEXT('MULTIPOINT(106 76,53 20,148 -40)'))
4260092.912246835
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-177 -88,-165 9,153 40,2 17)'), ST_GEOMFROMTEXT('MULTIPOINT(-150 -4)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-177 -88,-165 9,153 40,2 17)'), ST_GEOMFROMTEXT('MULTIPOINT(-150 -4)'))
2203222.520729071
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(154 84,-124 37,17 50)'), ST_GEOMFROMTEXT('MULTIPOINT(42 34)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(154 84,-124 37,17 50)'), ST_GEOMFROMTEXT('MULTIPOINT(42 34)'))
2703109.6592360293
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(88 -65,49 85,68 77)'), ST_GEOMFROMTEXT('MULTIPOINT(125 82,-83 -5,3 -40)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(88 -65,49 85,68 77)'), ST_GEOMFROMTEXT('MULTIPOINT(125 82,-83 -5,3 -40)'))
926947.16374
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(174 59,91 24,26 28)'), ST_GEOMFROMTEXT('MULTIPOINT(-35 -33,-171 -37,-30 -43)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(174 59,91 24,26 28)'), ST_GEOMFROMTEXT('MULTIPOINT(-35 -33,-171 -37,-30 -43)'))
9348158.18192
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-140 -63,103 -42,160 -53)'), ST_GEOMFROMTEXT('MULTIPOINT(-78 -80,-133 -24,73 -15)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-140 -63,103 -42,160 -53)'), ST_GEOMFROMTEXT('MULTIPOINT(-78 -80,-133 -24,73 -15)'))
2653984.28106
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(137 -65,-63 13,38 9)'), ST_GEOMFROMTEXT('MULTIPOINT(-166 -35,107 -18,-83 -18,91 -24)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(137 -65,-63 13,38 9)'), ST_GEOMFROMTEXT('MULTIPOINT(-166 -35,107 -18,-83 -18,91 -24)'))
4086108.7033282355
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-128 90,90 -17,-176 -37,40 -78,156 -82,37 -42)'), ST_GEOMFROMTEXT('MULTIPOINT(57 32,-3 22,24 -88)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-128 90,90 -17,-176 -37,40 -78,156 -82,37 -42)'), ST_GEOMFROMTEXT('MULTIPOINT(57 32,-3 22,24 -88)'))
1051350.22798656
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(87 -12,-25 31,-47 23,134 83,120 69,39 -41)'), ST_GEOMFROMTEXT('MULTIPOINT(-9 -4,-171 -82,140 -26)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(87 -12,-25 31,-47 23,134 83,120 69,39 -41)'), ST_GEOMFROMTEXT('MULTIPOINT(-9 -4,-171 -82,140 -26)'))
4245876.626705522
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-119 50,28 22,-122 -74)'), ST_GEOMFROMTEXT('MULTIPOINT(134 14,-32 -84,96 74,44 59,-88 73,-136 12)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-119 50,28 22,-122 -74)'), ST_GEOMFROMTEXT('MULTIPOINT(134 14,-32 -84,96 74,44 59,-88 73,-136 12)'))
1897030.29194
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-144 73,81 61,-78 4,50 -28)'),
ST_GEOMFROMTEXT('MULTIPOINT(-176 48,-154 -39,-140 -60,135 72,-97 28,-35 69)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-144 73,81 61,-78 4,50 -28)'),
ST_GEOMFROMTEXT('MULTIPOINT(-176 48,-154 -39,-140 -60,135 72,-97 28,-35 69)'))
2505975.110979326
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-14 49)'),
ST_GEOMFROMTEXT('MULTIPOINT(-160 -51,-141 72,50 -30,96 -64,-41 -59,-128 -28,0 -77,179 -78,-84 -67)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-14 49)'),
ST_GEOMFROMTEXT('MULTIPOINT(-160 -51,-141 72,50 -30,96 -64,-41 -59,-128 -28,0 -77,179 -78,-84 -67)'))
5941456.90499
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-165 61,-43 -47,-89 40,-137 -64,11 26,-8 -31,28 -77,37 -44,124 51)'),
ST_GEOMFROMTEXT('MULTIPOINT(63 39,98 14,-123 79,-30 -27)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(-165 61,-43 -47,-89 40,-137 -64,11 26,-8 -31,28 -77,37 -44,124 51)'),
ST_GEOMFROMTEXT('MULTIPOINT(63 39,98 14,-123 79,-30 -27)'))
2181430.45407528
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(11 -38,-17 54,-104 73)'),
ST_GEOMFROMTEXT('MULTIPOINT(167 -50,103 -21,-122 24,-122 80,-41 37,-175 -25,-155 48,-23 -34,-105 48)'));
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(11 -38,-17 54,-104 73)'),
ST_GEOMFROMTEXT('MULTIPOINT(167 -50,103 -21,-122 24,-122 80,-41 37,-175 -25,-155 48,-23 -34,-105 48)'))
898973.2896405652
#####################################################################################
# ST_DISTANCE_SPHERE with different earth radius value
#####################################################################################
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 1);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 1)
0.024682056391766436
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 10);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 10)
0.24682056391766435
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 100);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 100)
2.468205639176644
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 2000);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 2000)
49.364112783532875
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 1234567);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 1234567)
30471.652313413913
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 6370986);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 6370986)
157249.0357231545
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 6370987);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 6370987)
157249.06040521088
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 1234567890);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 1234567890)
30471674.280444104
#####################################################################################
# Invalid function calls
#####################################################################################
SELECT ST_DISTANCE_SPHERE();
ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE'
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(10 10)'));
ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE'
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(10 10)'),NULL);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(10 10)'),NULL)
NULL
SELECT ST_DISTANCE_SPHERE(NULL,ST_GEOMFROMTEXT('POINT(10 10)'));
ST_DISTANCE_SPHERE(NULL,ST_GEOMFROMTEXT('POINT(10 10)'))
NULL
SELECT ST_DISTANCE_SPHERE(NULL,ST_GEOMFROMTEXT(@star_top));
ST_DISTANCE_SPHERE(NULL,ST_GEOMFROMTEXT(@star_top))
NULL
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT(@star_of_elems),NULL);
ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT(@star_of_elems),NULL)
NULL
SELECT ST_DISTANCE_SPHERE(NULL,NULL);
ST_DISTANCE_SPHERE(NULL,NULL)
NULL
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT()'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT('!' 0)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!' 0)'),ST_GEOMFROMTEXT('POINT(0 0)'))' at line 1
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT()'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 12,34 a)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 12,34 0,1)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 22023: Invalid GIS data provided to function st_geometryfromtext.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(1 1,2 2,'!' 0)'),ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!' 0)'),ST_GEOMFROMTEXT('POINT(0 0)'))' at line 1
SELECT ST_DISTANCE_SPHERE(,);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT(@star_of_elems),);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
SELECT ST_DISTANCE_SPHERE(,ST_GEOMFROMTEXT(@star_top));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ST_GEOMFROMTEXT(@star_top))' at line 1
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(1 1))'), ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(0 0)))'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),GEOMETRYCOLLECTION())'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 1)'), ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 1)'), ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(1 1))'), ST_GEOMFROMTEXT('POINT(0 0)'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(0 0)))'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('MULTIPOINT(0 1)'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),GEOMETRYCOLLECTION())'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
ERROR HY000: Calling geometry function st_distance_sphere with unsupported types of arguments.
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), -200);
ERROR HY000: Incorrect arguments to st_distance_sphere
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), -1);
ERROR HY000: Incorrect arguments to st_distance_sphere
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 0);
ERROR HY000: Incorrect arguments to st_distance_sphere
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(200 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 200);
ERROR HY000: Incorrect arguments to st_distance_sphere
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(20 1)'), ST_GEOMFROMTEXT('POINT(0 100)'), 200);
ERROR HY000: Incorrect arguments to st_distance_sphere
SELECT ST_DISTANCE_SPHERE(ST_GEOMFROMTEXT('POINT(1 1)'), ST_GEOMFROMTEXT('POINT(0 0)'), 200, 300);
ERROR 42000: Incorrect parameter count in the call to native function 'ST_DISTANCE_SPHERE'
# Clean up
DROP TABLE gis_geometrycollection;

Man Man