Commit d551c922 authored by Sergei Golubchik's avatar Sergei Golubchik

GIS fixes for --view

parent dd040b5c
...@@ -5534,14 +5534,14 @@ SELECT ST_ISVALID(@g); ...@@ -5534,14 +5534,14 @@ SELECT ST_ISVALID(@g);
ST_ISVALID(@g) ST_ISVALID(@g)
1 1
# Some tests for Polygons # Some tests for Polygons
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 0 2, 2 2, 1 1, 2 0, 0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 0 2, 2 2, 1 1, 2 0, 0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 0 2, 2 2, 1 1, 2 0, 0 0))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 2, 2 2, 2 0, 0 0)),((4 4, 4 5, 5 5, 5 4, 4 4)))')) AS a; SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 2, 2 2, 2 0, 0 0)),((4 4, 4 5, 5 5, 5 4, 4 4)))')) AS a;
a a
......
...@@ -3536,11 +3536,11 @@ SELECT ST_ISVALID(@g); ...@@ -3536,11 +3536,11 @@ SELECT ST_ISVALID(@g);
--echo # Some tests for Polygons --echo # Some tests for Polygons
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 0 2, 2 2, 1 1, 2 0, 0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 0 2, 2 2, 1 1, 2 0, 0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 2, 2 2, 2 0, 0 0)),((4 4, 4 5, 5 5, 5 4, 4 4)))')) AS a; SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 0 2, 2 2, 2 0, 0 0)),((4 4, 4 5, 5 5, 5 4, 4 4)))')) AS a;
......
...@@ -171,11 +171,11 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_center)) ...@@ -171,11 +171,11 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_center))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center)) FROM gis_geometrycollection WHERE fid=105; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center)) FROM gis_geometrycollection WHERE fid=105;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)')) c
0 0
#==================================================================================== #====================================================================================
# point,multipoint # point,multipoint
...@@ -189,20 +189,20 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_bottom_points)) ...@@ -189,20 +189,20 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_bottom_points))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points)) FROM gis_geometrycollection WHERE fid=106; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points)) FROM gis_geometrycollection WHERE fid=106;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,10 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c
0 0
#==================================================================================== #====================================================================================
# point,linestring # point,linestring
...@@ -216,17 +216,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_line_horizontal)) ...@@ -216,17 +216,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_line_horizontal))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center)) FROM gis_geometrycollection WHERE fid=104;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0,20 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0,20 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0,20 0)')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c
0 0
#==================================================================================== #====================================================================================
# point,multilinestring # point,multilinestring
...@@ -240,17 +240,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_lines_near_horizon ...@@ -240,17 +240,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_lines_near_horizon
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical)) FROM gis_geometrycollection WHERE fid=104;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 0))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,10 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,10 0))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')) c
0 0
#==================================================================================== #====================================================================================
# point,polygon # point,polygon
...@@ -270,17 +270,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_elem_vertical)) ...@@ -270,17 +270,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_elem_vertical))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star)) FROM gis_geometrycollection WHERE fid=104;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c
0 0
#==================================================================================== #====================================================================================
# point,multipolygon # point,multipolygon
...@@ -294,17 +294,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(-0.01 0)'),ST_GEOMFROMTEXT(@star_of_elems)) ...@@ -294,17 +294,17 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(-0.01 0)'),ST_GEOMFROMTEXT(@star_of_elems))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=104;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((10 10,10 20,20 20,20 10,10 10)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((10 10,10 20,20 20,20 10,10 10)))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((10 10,10 20,20 20,20 10,10 10)))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c
0 0
#==================================================================================== #====================================================================================
# point,geometrycollection # point,geometrycollection
...@@ -321,20 +321,20 @@ MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_collection_elems)) ...@@ -321,20 +321,20 @@ MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_collection_elems))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr)) MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr))
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5))')) c
1 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),GEOMETRYCOLLECTION())')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),GEOMETRYCOLLECTION())')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),GEOMETRYCOLLECTION())')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')) c
NULL NULL
#==================================================================================== #====================================================================================
# multipoint,point # multipoint,point
...@@ -540,8 +540,8 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_ele ...@@ -540,8 +540,8 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_ele
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3)) MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3))
0 0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((11 15,19 15,11 15)),((25 0,0 15,25 0)))')) FROM gis_geometrycollection WHERE fid=110; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((11 15,19 15,11 15)),((25 0,0 15,25 0)))')) c FROM gis_geometrycollection WHERE fid=110;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((11 15,19 15,11 15)),((25 0,0 15,25 0)))')) c
1 1
#==================================================================================== #====================================================================================
# linestring,geometrycollection # linestring,geometrycollection
...@@ -624,8 +624,8 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_li ...@@ -624,8 +624,8 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_li
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3)) MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3))
0 0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) FROM gis_geometrycollection WHERE fid=114; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) c FROM gis_geometrycollection WHERE fid=114;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) c
1 1
#==================================================================================== #====================================================================================
# multilinestring,polygon # multilinestring,polygon
...@@ -759,11 +759,11 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_elem_vertical)) ...@@ -759,11 +759,11 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_elem_vertical))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star)) MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star))
1 1
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) FROM gis_geometrycollection WHERE fid=100; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) c FROM gis_geometrycollection WHERE fid=100;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) c
0 0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) FROM gis_geometrycollection WHERE fid=100; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) c FROM gis_geometrycollection WHERE fid=100;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) c
0 0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical)) FROM gis_geometrycollection WHERE fid=400; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical)) FROM gis_geometrycollection WHERE fid=400;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical))
...@@ -777,8 +777,8 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_of_elems)) ...@@ -777,8 +777,8 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_of_elems))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems)) MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems))
1 1
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((25 0,25 5,30 0,25 0)),((25 15,25 20,30 15,25 15)))')) FROM gis_geometrycollection WHERE fid=100; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((25 0,25 5,30 0,25 0)),((25 15,25 20,30 15,25 15)))')) c FROM gis_geometrycollection WHERE fid=100;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((25 0,25 5,30 0,25 0)),((25 15,25 20,30 15,25 15)))')) c
0 0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=300; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=300;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems))
...@@ -1104,41 +1104,41 @@ SELECT MBRCOVEREDBY(fid,ST_GEOMFROMTEXT(@star_top)) FROM gis_geometrycollection, ...@@ -1104,41 +1104,41 @@ SELECT MBRCOVEREDBY(fid,ST_GEOMFROMTEXT(@star_top)) FROM gis_geometrycollection,
ERROR HY000: Illegal parameter data type int for operation 'mbrcoveredby' ERROR HY000: Illegal parameter data type int for operation 'mbrcoveredby'
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_of_elems),fid) FROM gis_geometrycollection,gis_geometrycollection_2 WHERE fid=103 and fid2=103; SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_of_elems),fid) FROM gis_geometrycollection,gis_geometrycollection_2 WHERE fid=103 and fid2=103;
ERROR HY000: Illegal parameter data type int for operation 'mbrcoveredby' ERROR HY000: Illegal parameter data type int for operation 'mbrcoveredby'
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT('!' 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT('!' 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'))' at line 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'))' at line 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'))' at line 1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c
NULL NULL
SELECT MBRCOVEREDBY(,); SELECT MBRCOVEREDBY(,);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
...@@ -1156,29 +1156,20 @@ DROP TABLE gis_geometrycollection_2; ...@@ -1156,29 +1156,20 @@ DROP TABLE gis_geometrycollection_2;
SELECT MBRCOVEREDBY( SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 0), ST_GEOMFROMTEXT('POINT(0 0)', 0),
ST_GEOMFROMTEXT('POINT(0 0)', 0) ST_GEOMFROMTEXT('POINT(0 0)', 0)
); ) c;
MBRCOVEREDBY( c
ST_GEOMFROMTEXT('POINT(0 0)', 0),
ST_GEOMFROMTEXT('POINT(0 0)', 0)
)
1 1
# Projected SRS (should pass) # Projected SRS (should pass)
SELECT MBRCOVEREDBY( SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 2000), ST_GEOMFROMTEXT('POINT(0 0)', 2000),
ST_GEOMFROMTEXT('POINT(0 0)', 2000) ST_GEOMFROMTEXT('POINT(0 0)', 2000)
); ) c;
MBRCOVEREDBY( c
ST_GEOMFROMTEXT('POINT(0 0)', 2000),
ST_GEOMFROMTEXT('POINT(0 0)', 2000)
)
1 1
# Geographic SRS (should pass) # Geographic SRS (should pass)
SELECT MBRCOVEREDBY( SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 0)', 4326),
ST_GEOMFROMTEXT('POINT(0 0)', 4326) ST_GEOMFROMTEXT('POINT(0 0)', 4326)
); ) c;
MBRCOVEREDBY( c
ST_GEOMFROMTEXT('POINT(0 0)', 4326),
ST_GEOMFROMTEXT('POINT(0 0)', 4326)
)
1 1
...@@ -218,9 +218,9 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_center)); ...@@ -218,9 +218,9 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_center));
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center)) FROM gis_geometrycollection WHERE fid=105; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center)) FROM gis_geometrycollection WHERE fid=105;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # point,multipoint --echo # point,multipoint
...@@ -231,15 +231,15 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_bottom_poin ...@@ -231,15 +231,15 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_bottom_poin
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points)) FROM gis_geometrycollection WHERE fid=106; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points)) FROM gis_geometrycollection WHERE fid=106;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,10 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # point,linestring --echo # point,linestring
...@@ -250,13 +250,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_line_horizo ...@@ -250,13 +250,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_line_horizo
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center)) FROM gis_geometrycollection WHERE fid=104;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0,20 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0,20 0)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # point,multilinestring --echo # point,multilinestring
...@@ -267,13 +267,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_lines_near_ ...@@ -267,13 +267,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_lines_near_
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical)) FROM gis_geometrycollection WHERE fid=104;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 0))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,10 0))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # point,polygon --echo # point,polygon
...@@ -288,13 +288,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_elem_vertic ...@@ -288,13 +288,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_elem_vertic
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star)) FROM gis_geometrycollection WHERE fid=104;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # point,multipolygon --echo # point,multipolygon
...@@ -305,13 +305,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(-0.01 0)'),ST_GEOMFROMTEXT(@star_of_e ...@@ -305,13 +305,13 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(-0.01 0)'),ST_GEOMFROMTEXT(@star_of_e
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=104; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=104;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((10 10,10 20,20 20,20 10,10 10)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((10 10,10 20,20 20,20 10,10 10)))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # point,geometrycollection --echo # point,geometrycollection
...@@ -324,15 +324,15 @@ SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_collection_elems)) FROM gis_geometry ...@@ -324,15 +324,15 @@ SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_collection_elems)) FROM gis_geometry
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr));
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),GEOMETRYCOLLECTION())')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),GEOMETRYCOLLECTION())')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # multipoint,point --echo # multipoint,point
...@@ -483,7 +483,7 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star ...@@ -483,7 +483,7 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3));
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((11 15,19 15,11 15)),((25 0,0 15,25 0)))')) FROM gis_geometrycollection WHERE fid=110; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((11 15,19 15,11 15)),((25 0,0 15,25 0)))')) c FROM gis_geometrycollection WHERE fid=110;
--echo #==================================================================================== --echo #====================================================================================
--echo # linestring,geometrycollection --echo # linestring,geometrycollection
...@@ -544,7 +544,7 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@ ...@@ -544,7 +544,7 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3));
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) FROM gis_geometrycollection WHERE fid=114; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) c FROM gis_geometrycollection WHERE fid=114;
--echo #==================================================================================== --echo #====================================================================================
--echo # multilinestring,polygon --echo # multilinestring,polygon
...@@ -642,9 +642,9 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_elem_vertical)) ...@@ -642,9 +642,9 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_elem_vertical))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star));
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) FROM gis_geometrycollection WHERE fid=100; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) c FROM gis_geometrycollection WHERE fid=100;
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) FROM gis_geometrycollection WHERE fid=100; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) c FROM gis_geometrycollection WHERE fid=100;
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical)) FROM gis_geometrycollection WHERE fid=400; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical)) FROM gis_geometrycollection WHERE fid=400;
...@@ -655,7 +655,7 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_of_elems)); ...@@ -655,7 +655,7 @@ SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_of_elems));
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems)); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems));
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((25 0,25 5,30 0,25 0)),((25 15,25 20,30 15,25 15)))')) FROM gis_geometrycollection WHERE fid=100; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((25 0,25 5,30 0,25 0)),((25 15,25 20,30 15,25 15)))')) c FROM gis_geometrycollection WHERE fid=100;
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=300; SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=300;
...@@ -901,34 +901,34 @@ SELECT MBRCOVEREDBY(fid,ST_GEOMFROMTEXT(@star_top)) FROM gis_geometrycollection, ...@@ -901,34 +901,34 @@ SELECT MBRCOVEREDBY(fid,ST_GEOMFROMTEXT(@star_top)) FROM gis_geometrycollection,
--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_of_elems),fid) FROM gis_geometrycollection,gis_geometrycollection_2 WHERE fid=103 and fid2=103; SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_of_elems),fid) FROM gis_geometrycollection,gis_geometrycollection_2 WHERE fid=103 and fid2=103;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
--error ER_PARSE_ERROR --error ER_PARSE_ERROR
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT('!' 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT('!' 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
--error ER_PARSE_ERROR --error ER_PARSE_ERROR
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
--error ER_PARSE_ERROR --error ER_PARSE_ERROR
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')); SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)')) c;
--error ER_PARSE_ERROR --error ER_PARSE_ERROR
SELECT MBRCOVEREDBY(,); SELECT MBRCOVEREDBY(,);
...@@ -951,16 +951,16 @@ DROP TABLE gis_geometrycollection_2; ...@@ -951,16 +951,16 @@ DROP TABLE gis_geometrycollection_2;
SELECT MBRCOVEREDBY( SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 0), ST_GEOMFROMTEXT('POINT(0 0)', 0),
ST_GEOMFROMTEXT('POINT(0 0)', 0) ST_GEOMFROMTEXT('POINT(0 0)', 0)
); ) c;
--echo # Projected SRS (should pass) --echo # Projected SRS (should pass)
SELECT MBRCOVEREDBY( SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 2000), ST_GEOMFROMTEXT('POINT(0 0)', 2000),
ST_GEOMFROMTEXT('POINT(0 0)', 2000) ST_GEOMFROMTEXT('POINT(0 0)', 2000)
); ) c;
--echo # Geographic SRS (should pass) --echo # Geographic SRS (should pass)
SELECT MBRCOVEREDBY( SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 4326), ST_GEOMFROMTEXT('POINT(0 0)', 4326),
ST_GEOMFROMTEXT('POINT(0 0)', 4326) ST_GEOMFROMTEXT('POINT(0 0)', 4326)
); ) c;
...@@ -13,17 +13,13 @@ INSERT INTO table_simple_aggregation ( grouping_condition, location ) VALUES ...@@ -13,17 +13,13 @@ INSERT INTO table_simple_aggregation ( grouping_condition, location ) VALUES
# result shall be 1 # result shall be 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM SELECT ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2 table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2
0,3 0) ',4326)); 0,3 0) ',4326)) c;
ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM c
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2
0,3 0) ',4326))
1 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM SELECT ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3 table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3
0) ',4326)); 0) ',4326)) c;
ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM c
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3
0) ',4326))
1 1
INSERT INTO table_simple_aggregation (location) VALUES INSERT INTO table_simple_aggregation (location) VALUES
( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)), ( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)),
...@@ -33,35 +29,30 @@ INSERT INTO table_simple_aggregation (location) VALUES ...@@ -33,35 +29,30 @@ INSERT INTO table_simple_aggregation (location) VALUES
# the result here shall be 1 # the result here shall be 1
SELECT ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM SELECT ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM
table_simple_aggregation), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION( MULTIPOINT(0 table_simple_aggregation), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION( MULTIPOINT(0
0,1 0,3 0), MULTIPOINT(2 0,0 0), POINT(0 0))',4326)); 0,1 0,3 0), MULTIPOINT(2 0,0 0), POINT(0 0))',4326)) c;
ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM c
table_simple_aggregation), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION( MULTIPOINT(0
0,1 0,3 0), MULTIPOINT(2 0,0 0), POINT(0 0))',4326))
1 1
# F-1 ST_COLLECT SHALL only return NULL if all elements are NULL or the # F-1 ST_COLLECT SHALL only return NULL if all elements are NULL or the
# aggregate is empty. # aggregate is empty.
# as only a null is aggregated the result of the subquery shall be NULL # as only a null is aggregated the result of the subquery shall be NULL
# and the result of the whole query shall be 1 # and the result of the whole query shall be 1
SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
location = NULL) IS NULL; location = NULL) IS NULL c;
(SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE c
location = NULL) IS NULL
1 1
# as no element is aggregated the result of the subquery shall be NULL # as no element is aggregated the result of the subquery shall be NULL
# and the result of the whole query shall be 1 # and the result of the whole query shall be 1
SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
st_srid(location)=2110) IS NULL; st_srid(location)=2110) IS NULL c;
(SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE c
st_srid(location)=2110) IS NULL
1 1
INSERT INTO table_simple_aggregation (location) VALUES INSERT INTO table_simple_aggregation (location) VALUES
( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)), ( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)),
( NULL), ( NULL),
( NULL); ( NULL);
SELECT ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND SELECT ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND
CURRENT ROW)) FROM table_simple_aggregation; CURRENT ROW)) c FROM table_simple_aggregation;
ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND c
CURRENT ROW))
MULTIPOINT(0 0) MULTIPOINT(0 0)
MULTIPOINT(0 0,0 0) MULTIPOINT(0 0,0 0)
MULTIPOINT(0 0,1 0) MULTIPOINT(0 0,1 0)
......
...@@ -32,12 +32,12 @@ INSERT INTO table_simple_aggregation ( grouping_condition, location ) VALUES ...@@ -32,12 +32,12 @@ INSERT INTO table_simple_aggregation ( grouping_condition, location ) VALUES
--echo # result shall be 1 --echo # result shall be 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM SELECT ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2 table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2
0,3 0) ',4326)); 0,3 0) ',4326)) c;
# --echo # Functional requirement F-8 Shall support DISTINCT in aggregates # --echo # Functional requirement F-8 Shall support DISTINCT in aggregates
# --echo # result shall be 1 # --echo # result shall be 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM SELECT ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3 table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3
0) ',4326)); 0) ',4326)) c;
# --echo # Functional requirement F-5: ST_COLLECT shall support group by, which # --echo # Functional requirement F-5: ST_COLLECT shall support group by, which
# --echo # is given by aggregation machinery # --echo # is given by aggregation machinery
# --echo # result shall be # --echo # result shall be
...@@ -61,24 +61,24 @@ INSERT INTO table_simple_aggregation (location) VALUES ...@@ -61,24 +61,24 @@ INSERT INTO table_simple_aggregation (location) VALUES
--echo # the result here shall be 1 --echo # the result here shall be 1
SELECT ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM SELECT ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM
table_simple_aggregation), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION( MULTIPOINT(0 table_simple_aggregation), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION( MULTIPOINT(0
0,1 0,3 0), MULTIPOINT(2 0,0 0), POINT(0 0))',4326)); 0,1 0,3 0), MULTIPOINT(2 0,0 0), POINT(0 0))',4326)) c;
--echo # F-1 ST_COLLECT SHALL only return NULL if all elements are NULL or the --echo # F-1 ST_COLLECT SHALL only return NULL if all elements are NULL or the
--echo # aggregate is empty. --echo # aggregate is empty.
--echo # as only a null is aggregated the result of the subquery shall be NULL --echo # as only a null is aggregated the result of the subquery shall be NULL
--echo # and the result of the whole query shall be 1 --echo # and the result of the whole query shall be 1
SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
location = NULL) IS NULL; location = NULL) IS NULL c;
--echo # as no element is aggregated the result of the subquery shall be NULL --echo # as no element is aggregated the result of the subquery shall be NULL
--echo # and the result of the whole query shall be 1 --echo # and the result of the whole query shall be 1
SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
st_srid(location)=2110) IS NULL; st_srid(location)=2110) IS NULL c;
INSERT INTO table_simple_aggregation (location) VALUES INSERT INTO table_simple_aggregation (location) VALUES
( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)), ( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)),
( NULL), ( NULL),
( NULL); ( NULL);
SELECT ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND SELECT ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND
CURRENT ROW)) FROM table_simple_aggregation; CURRENT ROW)) c FROM table_simple_aggregation;
# --echo Excercising multiple code paths. # --echo Excercising multiple code paths.
......
...@@ -184,31 +184,23 @@ ERROR 42S22: Unknown column 'abcdef' in 'field list' ...@@ -184,31 +184,23 @@ ERROR 42S22: Unknown column 'abcdef' in 'field list'
# very long geohash # very long geohash
SELECT ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm" SELECT ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm"
"npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567" "npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567"
"89bcdefghjkmnpqrstuvwxyz"); "89bcdefghjkmnpqrstuvwxyz") c;
ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm" c
"npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567"
"89bcdefghjkmnpqrstuvwxyz")
-179.55743439816956 -179.55743439816956
SELECT ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM" SELECT ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM"
"NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567" "NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567"
"89BCDEFGHJKMNPQRSTUVWXYZ"); "89BCDEFGHJKMNPQRSTUVWXYZ") c;
ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM" c
"NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567"
"89BCDEFGHJKMNPQRSTUVWXYZ")
-179.55743439816956 -179.55743439816956
SELECT ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed" SELECT ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed"
"cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts" "cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts"
"rqpnmkjhgfedcb9876543210"); "rqpnmkjhgfedcb9876543210") c;
ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed" c
"cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts"
"rqpnmkjhgfedcb9876543210")
179.55743439816956 179.55743439816956
SELECT ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED" SELECT ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED"
"CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS" "CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS"
"RQPNMKJHGFEDCB9876543210"); "RQPNMKJHGFEDCB9876543210") c;
ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED" c
"CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS"
"RQPNMKJHGFEDCB9876543210")
179.55743439816956 179.55743439816956
CREATE TABLE geohashes (gid INT NOT NULL PRIMARY KEY, hash_value VARCHAR(255)); CREATE TABLE geohashes (gid INT NOT NULL PRIMARY KEY, hash_value VARCHAR(255));
INSERT INTO geohashes VALUES INSERT INTO geohashes VALUES
...@@ -435,31 +427,23 @@ ERROR 42S22: Unknown column 'abcdef' in 'field list' ...@@ -435,31 +427,23 @@ ERROR 42S22: Unknown column 'abcdef' in 'field list'
# very long geohash # very long geohash
SELECT ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn" SELECT ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn"
"pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789" "pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789"
"bcdefghjkmnpqrstuvwxyz"); "bcdefghjkmnpqrstuvwxyz") c;
ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn" c
"pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789"
"bcdefghjkmnpqrstuvwxyz")
-82.77450549262497 -82.77450549262497
SELECT ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN" SELECT ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN"
"PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789" "PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789"
"BCDEFGHJKMNPQRSTUVWXYZ"); "BCDEFGHJKMNPQRSTUVWXYZ") c;
ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN" c
"PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789"
"BCDEFGHJKMNPQRSTUVWXYZ")
-82.77450549262497 -82.77450549262497
SELECT ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc" SELECT ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc"
"b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq" "b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq"
"pnmkjhgfedcb9876543210"); "pnmkjhgfedcb9876543210") c;
ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc" c
"b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq"
"pnmkjhgfedcb9876543210")
82.77450549262497 82.77450549262497
SELECT ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC" SELECT ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC"
"B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ" "B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ"
"PNMKJHGFEDCB9876543210"); "PNMKJHGFEDCB9876543210") c;
ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC" c
"B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ"
"PNMKJHGFEDCB9876543210")
82.77450549262497 82.77450549262497
# different random geohash values # different random geohash values
SELECT ST_LATFROMGEOHASH(hash_value) FROM geohashes; SELECT ST_LATFROMGEOHASH(hash_value) FROM geohashes;
...@@ -576,20 +560,20 @@ POINT(180 50) ...@@ -576,20 +560,20 @@ POINT(180 50)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0)) ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0))
POINT(0 -50) POINT(0 -50)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0)) c
POINT(-145.16129032258067 -49.35483870967742) POINT(-145.16129032258067 -49.35483870967742)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0)) c
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c
POINT(179.55743439816956 82.77450549262497) POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c
POINT(179.55743439816956 82.77450549262497) POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " ")); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " "));
ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " ")) ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " "))
...@@ -609,14 +593,14 @@ POINT(-133.548387096774 -84.1935483870967) ...@@ -609,14 +593,14 @@ POINT(-133.548387096774 -84.1935483870967)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0)) ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0))
POINT(-110.3225806451612 8.7096774193548) POINT(-110.3225806451612 8.7096774193548)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** ")); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** ")) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** ")) c
POINT(-180 -90) POINT(-180 -90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 ")); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 "));
ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 ")) ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 "))
POINT(-180 -90) POINT(-180 -90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))) c
POINT(180 90) POINT(180 90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0));
ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0)) ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0))
...@@ -633,8 +617,8 @@ NULL ...@@ -633,8 +617,8 @@ NULL
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0));
ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0)) ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0))
POINT(-179 -82) POINT(-179 -82)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))) c
POINT(180 90) POINT(180 90)
# invalid characters and inputs # invalid characters and inputs
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123a45", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123a45", 0));
...@@ -690,31 +674,23 @@ ERROR 21000: Operand should contain 1 column(s) ...@@ -690,31 +674,23 @@ ERROR 21000: Operand should contain 1 column(s)
# very long geohash # very long geohash
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr" "defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0)); "stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc" c
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0))
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC"
"DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR" "DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR"
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)); "STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC" c
"DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR"
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0))
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn"
"mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98" "mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98"
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0)); "76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn" c
"mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98"
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0))
POINT(179.55743439816956 82.77450549262497) POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN"
"MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98" "MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98"
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)); "76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN" c
"MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98"
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0))
POINT(179.55743439816956 82.77450549262497) POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr" "defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
...@@ -726,11 +702,8 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789 ...@@ -726,11 +702,8 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789
"bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmnp" "bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmnp"
"qrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01" "qrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01"
"23456789bcdefghjkmnpqrstuvwxyz0123456789bcde" "23456789bcdefghjkmnpqrstuvwxyz0123456789bcde"
"fghjkmnpqrstuvwxyz", 4326)); "fghjkmnpqrstuvwxyz", 4326)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc" c
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123"
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
# different random geohash values # different random geohash values
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(hash_value,0)) FROM geohashes; SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(hash_value,0)) FROM geohashes;
...@@ -883,29 +856,29 @@ cb0bh2n0p0581b0bh2n0p8 ...@@ -883,29 +856,29 @@ cb0bh2n0p0581b0bh2n0p8
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75);
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75) ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75)
3b0bh2n0p0581b0bh2n0p8 3b0bh2n0p0581b0bh2n0p8
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 0.0001)'))),80); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 0.0001)'))),80) c;
ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 0.0001)'))),80) c
s0000000d6dsd0dzz1ms0zz7z1wzhy00000000000000000000000000000000000000000000000000 s0000000d6dsd0dzz1ms0zz7z1wzhy00000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 -0.0001)'))),85); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 -0.0001)'))),85) c;
ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 -0.0001)'))),85) c
kpbpbpbp6m6e6p6bpntebbpkpnqbuf0000000000000000000000000000000000000000000000000000000 kpbpbpbp6m6e6p6bpntebbpkpnqbuf0000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 0.0001)'))),90); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 0.0001)'))),90) c;
ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 0.0001)'))),90) c
ebpbpbpbtdtktbtpbc6kppbebc9p5q000000000000000000000000000000000000000000000000000000000000 ebpbpbpbtdtktbtpbc6kppbebc9p5q000000000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'))),100); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'))),100) c;
ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'))),100) c
7zzzzzzzmtm7mzm00yd7z00s0y30g60000000000000000000000000000000000000000000000000000000000000000000000 7zzzzzzzmtm7mzm00yd7z00s0y30g60000000000000000000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20) c;
ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20) c
zzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20) c;
ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20) c
bpbpbpbpbpbpbpbpbpbp bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20) c;
ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20) c
pbpbpbpbpbpbpbpbpbpb pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20) c;
ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20) c
00000000000000000000 00000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1"); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1");
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1") ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1")
...@@ -922,20 +895,20 @@ NULL ...@@ -922,20 +895,20 @@ NULL
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL);
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL) ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL)
7zzzzzzzmtm7mzm00yd7z00s0y30g60000000000000000000000000000000000000000000000000000000000000000000000 7zzzzzzzmtm7mzm00yd7z00s0y30g60000000000000000000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(180 90)'),ST_GEOMFROMTEXT('POINT(0 0)')),20); SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(180 90)'),ST_GEOMFROMTEXT('POINT(0 0)')),20) c;
ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(180 90)'),ST_GEOMFROMTEXT('POINT(0 0)')),20) c
zzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(-180 90)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,100 100)')),20); SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(-180 90)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,100 100)')),20) c;
ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(-180 90)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,100 100)')),20) c
bpbpbpbpbpbpbpbpbpbp bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(180 -90)'),ST_GEOMFROMTEXT('POINT(180 -90)')),20); SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(180 -90)'),ST_GEOMFROMTEXT('POINT(180 -90)')),20) c;
ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(180 -90)'),ST_GEOMFROMTEXT('POINT(180 -90)')),20) c
pbpbpbpbpbpbpbpbpbpb pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-180 -90)'),ST_GEOMFROMTEXT('POINT(-180 -90)')),20); SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-180 -90)'),ST_GEOMFROMTEXT('POINT(-180 -90)')),20) c;
ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-180 -90)'),ST_GEOMFROMTEXT('POINT(-180 -90)')),20) c
00000000000000000000 00000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY))); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY))) c;
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY))) c
zzzzzzzzzz zzzzzzzzzz
SELECT ST_GEOHASH((CAST(10 AS BINARY)),20,1); SELECT ST_GEOHASH((CAST(10 AS BINARY)),20,1);
ST_GEOHASH((CAST(10 AS BINARY)),20,1) ST_GEOHASH((CAST(10 AS BINARY)),20,1)
...@@ -1162,29 +1135,29 @@ ST_LONGFROMGEOHASH(ST_GEOHASH(-179.999999,0,20)) ...@@ -1162,29 +1135,29 @@ ST_LONGFROMGEOHASH(ST_GEOHASH(-179.999999,0,20))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20));
ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20)) ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20))
180 180
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10)) c
100 100
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c
10 10
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10)) c
-10 -10
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10)) c
1 1
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10)) c
-1 -1
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20)) c
1.00101 1.00101
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20)) c
-1.00101 -1.00101
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10)) c;
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10)) c
20 20
#============================================================= #=============================================================
# ST_LATFROMGEOHASH() # ST_LATFROMGEOHASH()
...@@ -1225,29 +1198,29 @@ ST_LATFROMGEOHASH(ST_GEOHASH(0,89.999999,20)) ...@@ -1225,29 +1198,29 @@ ST_LATFROMGEOHASH(ST_GEOHASH(0,89.999999,20))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20));
ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20)) ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20))
90 90
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10)) c
50 50
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c
10 10
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10)) c
-10 -10
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10)) c
1 1
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10)) c
-1 -1
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20)) c
1.00101 1.00101
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20)) c
-1.00101 -1.00101
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10)) c;
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10)) c
-20 -20
#============================================================= #=============================================================
# ST_POINTFROMGEOHASH() # ST_POINTFROMGEOHASH()
...@@ -1306,29 +1279,29 @@ POINT(0 -89.999999) ...@@ -1306,29 +1279,29 @@ POINT(0 -89.999999)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(18*10,900/10,20),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(18*10,900/10,20),0));
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(18*10,900/10,20),0)) ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(18*10,900/10,20),0))
POINT(180 90) POINT(180 90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 50)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 50)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 50)'),10),0)) c
POINT(100 50) POINT(100 50)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10),0)) c
POINT(10 10) POINT(10 10)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10),0)) c
POINT(-10 10) POINT(-10 10)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 1.00010)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 1.00010)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 1.00010)'),10),0)) c
POINT(1 1.0001) POINT(1 1.0001)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 -1.1010)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 -1.1010)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 -1.1010)'),10),0)) c
POINT(-1 -1.101) POINT(-1 -1.101)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 1.000)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 1.000)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 1.000)'),10),0)) c
POINT(1.00101 1) POINT(1.00101 1)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 -1.0000)'),20),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 -1.0000)'),20),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 -1.0000)'),20),0)) c
POINT(-1.00101 -1) POINT(-1.00101 -1)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10),0)) c;
ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10),0)) c
POINT(20 20) POINT(20 20)
#============================================================= #=============================================================
# ST_GEOHASH() # ST_GEOHASH()
...@@ -1372,96 +1345,80 @@ pbpbpbpbpbpbpbpbpbpb ...@@ -1372,96 +1345,80 @@ pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20); SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20);
ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20) ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20)
bpbpbpbpbpbpbpbpbpbp bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c
zzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20) c
00000000000000000000 00000000000000000000
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20) c
pbpbpbpbpbpbpbpbpbpb pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c
bpbpbpbpbpbpbpbpbpbp bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c
zzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c
pbpbpbpbpbpbpbpbpbpb pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20) c
zzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c
bpbpbpbpbpbpbpbpbpbp bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c;
ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c
00000000000000000000 00000000000000000000
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
ST_LONGFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci)
-179.55743439816956 -179.55743439816956
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
ST_LONGFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci)
-179.55743439816956 -179.55743439816956
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
ST_LONGFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci)
-179.55743439816956 -179.55743439816956
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
ST_LONGFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci)
-179.55743439816956 -179.55743439816956
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
ST_LATFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci)
-82.77450549262497 -82.77450549262497
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
ST_LATFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci)
-82.77450549262497 -82.77450549262497
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
ST_LATFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci)
-82.77450549262497 -82.77450549262497
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
ST_LATFROMGEOHASH( c
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci)
-82.77450549262497 -82.77450549262497
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1470,14 +1427,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" ...@@ -1470,14 +1427,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci,
4326 4326
) )
); ) c;
ST_ASTEXT( c
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci,
4326
)
)
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1486,14 +1437,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" ...@@ -1486,14 +1437,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci,
4326 4326
) )
); ) c;
ST_ASTEXT( c
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci,
4326
)
)
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1502,14 +1447,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" ...@@ -1502,14 +1447,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci,
4326 4326
) )
); ) c;
ST_ASTEXT( c
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci,
4326
)
)
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1518,14 +1457,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" ...@@ -1518,14 +1457,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci,
4326 4326
) )
); ) c;
ST_ASTEXT( c
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci,
4326
)
)
POINT(-179.55743439816956 -82.77450549262497) POINT(-179.55743439816956 -82.77450549262497)
CREATE TABLE t1 (val DOUBLE); CREATE TABLE t1 (val DOUBLE);
INSERT INTO t1 (val) VALUES (12.2); INSERT INTO t1 (val) VALUES (12.2);
...@@ -1670,8 +1603,8 @@ ST_LatFromGeoHash('xkcd') ...@@ -1670,8 +1603,8 @@ ST_LatFromGeoHash('xkcd')
SELECT ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4); SELECT ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4);
ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4) ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4)
s020 s020
SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d'); SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d') c;
ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d') c
-25.098643334722453 -25.098643334722453
# #
# Bug#22838668 CRASH IN ITEM_FUNC_LATLONGFROMGEOHASH::VAL_REAL # Bug#22838668 CRASH IN ITEM_FUNC_LATLONGFROMGEOHASH::VAL_REAL
......
...@@ -187,19 +187,19 @@ SELECT ST_LONGFROMGEOHASH(abcdef); ...@@ -187,19 +187,19 @@ SELECT ST_LONGFROMGEOHASH(abcdef);
--echo # very long geohash --echo # very long geohash
SELECT ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm" SELECT ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm"
"npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567" "npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567"
"89bcdefghjkmnpqrstuvwxyz"); "89bcdefghjkmnpqrstuvwxyz") c;
SELECT ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM" SELECT ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM"
"NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567" "NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567"
"89BCDEFGHJKMNPQRSTUVWXYZ"); "89BCDEFGHJKMNPQRSTUVWXYZ") c;
SELECT ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed" SELECT ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed"
"cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts" "cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts"
"rqpnmkjhgfedcb9876543210"); "rqpnmkjhgfedcb9876543210") c;
SELECT ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED" SELECT ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED"
"CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS" "CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS"
"RQPNMKJHGFEDCB9876543210"); "RQPNMKJHGFEDCB9876543210") c;
# Table with different extreme values # Table with different extreme values
CREATE TABLE geohashes (gid INT NOT NULL PRIMARY KEY, hash_value VARCHAR(255)); CREATE TABLE geohashes (gid INT NOT NULL PRIMARY KEY, hash_value VARCHAR(255));
...@@ -394,19 +394,19 @@ SELECT ST_LATFROMGEOHASH(abcdef); ...@@ -394,19 +394,19 @@ SELECT ST_LATFROMGEOHASH(abcdef);
--echo # very long geohash --echo # very long geohash
SELECT ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn" SELECT ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn"
"pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789" "pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789"
"bcdefghjkmnpqrstuvwxyz"); "bcdefghjkmnpqrstuvwxyz") c;
SELECT ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN" SELECT ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN"
"PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789" "PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789"
"BCDEFGHJKMNPQRSTUVWXYZ"); "BCDEFGHJKMNPQRSTUVWXYZ") c;
SELECT ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc" SELECT ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc"
"b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq" "b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq"
"pnmkjhgfedcb9876543210"); "pnmkjhgfedcb9876543210") c;
SELECT ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC" SELECT ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC"
"B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ" "B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ"
"PNMKJHGFEDCB9876543210"); "PNMKJHGFEDCB9876543210") c;
--echo # different random geohash values --echo # different random geohash values
SELECT ST_LATFROMGEOHASH(hash_value) FROM geohashes; SELECT ST_LATFROMGEOHASH(hash_value) FROM geohashes;
...@@ -479,15 +479,15 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zbzurypzpgxczbzurypz", 0)); ...@@ -479,15 +479,15 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zbzurypzpgxczbzurypz", 0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " ")); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " "));
...@@ -501,11 +501,11 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("11111111111111111111", 0)); ...@@ -501,11 +501,11 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("11111111111111111111", 0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** ")); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** ")) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 ")); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 "));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0));
...@@ -517,7 +517,7 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("9zzzzzzzzzzzzzzzzzzz", null)); ...@@ -517,7 +517,7 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("9zzzzzzzzzzzzzzzzzzz", null));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))) c;
# Invalid characters and inputs # Invalid characters and inputs
...@@ -601,19 +601,19 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH((1, 1), 1)); ...@@ -601,19 +601,19 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH((1, 1), 1));
--echo # very long geohash --echo # very long geohash
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr" "defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0)); "stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC"
"DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR" "DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR"
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)); "STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn"
"mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98" "mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98"
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0)); "76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN"
"MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98" "MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98"
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)); "76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc" SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr" "defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
...@@ -625,7 +625,7 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789 ...@@ -625,7 +625,7 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789
"bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmnp" "bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmnp"
"qrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01" "qrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01"
"23456789bcdefghjkmnpqrstuvwxyz0123456789bcde" "23456789bcdefghjkmnpqrstuvwxyz0123456789bcde"
"fghjkmnpqrstuvwxyz", 4326)); "fghjkmnpqrstuvwxyz", 4326)) c;
--echo # different random geohash values --echo # different random geohash values
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(hash_value,0)) FROM geohashes; SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(hash_value,0)) FROM geohashes;
...@@ -723,21 +723,21 @@ SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 45)'),70); ...@@ -723,21 +723,21 @@ SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 45)'),70);
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75);
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 0.0001)'))),80); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 0.0001)'))),80) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 -0.0001)'))),85); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 -0.0001)'))),85) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 0.0001)'))),90); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 0.0001)'))),90) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'))),100); SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'))),100) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20) c;
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20); SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20) c;
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1"); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1");
...@@ -749,15 +749,15 @@ SELECT ST_GEOHASH(NULL,100); ...@@ -749,15 +749,15 @@ SELECT ST_GEOHASH(NULL,100);
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL);
SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(180 90)'),ST_GEOMFROMTEXT('POINT(0 0)')),20); SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(180 90)'),ST_GEOMFROMTEXT('POINT(0 0)')),20) c;
SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(-180 90)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,100 100)')),20); SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(-180 90)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,100 100)')),20) c;
SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(180 -90)'),ST_GEOMFROMTEXT('POINT(180 -90)')),20); SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(180 -90)'),ST_GEOMFROMTEXT('POINT(180 -90)')),20) c;
SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-180 -90)'),ST_GEOMFROMTEXT('POINT(-180 -90)')),20); SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-180 -90)'),ST_GEOMFROMTEXT('POINT(-180 -90)')),20) c;
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY))); SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY))) c;
SELECT ST_GEOHASH((CAST(10 AS BINARY)),20,1); SELECT ST_GEOHASH((CAST(10 AS BINARY)),20,1);
...@@ -1055,21 +1055,21 @@ SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(-179.999999,0,20)); ...@@ -1055,21 +1055,21 @@ SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(-179.999999,0,20));
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20));
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20)) c;
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10)); SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10)) c;
--echo #============================================================= --echo #=============================================================
--echo # ST_LATFROMGEOHASH() --echo # ST_LATFROMGEOHASH()
...@@ -1098,21 +1098,21 @@ SELECT ST_LATFROMGEOHASH(ST_GEOHASH(0,89.999999,20)); ...@@ -1098,21 +1098,21 @@ SELECT ST_LATFROMGEOHASH(ST_GEOHASH(0,89.999999,20));
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20));
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20)) c;
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10)); SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10)) c;
--echo #============================================================= --echo #=============================================================
--echo # ST_POINTFROMGEOHASH() --echo # ST_POINTFROMGEOHASH()
...@@ -1154,21 +1154,21 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(0,-89.999999,20),0)); ...@@ -1154,21 +1154,21 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(0,-89.999999,20),0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(18*10,900/10,20),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(18*10,900/10,20),0));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 50)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 50)'),10),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 1.00010)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 1.00010)'),10),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 -1.1010)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 -1.1010)'),10),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 1.000)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 1.000)'),10),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 -1.0000)'),20),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 -1.0000)'),20),0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10),0)); SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10),0)) c;
--echo #============================================================= --echo #=============================================================
--echo # ST_GEOHASH() --echo # ST_GEOHASH()
...@@ -1199,23 +1199,23 @@ SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb",0),20); ...@@ -1199,23 +1199,23 @@ SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb",0),20);
SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20); SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20);
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20); SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c;
##################################################################### #####################################################################
# Bug#19657725 # Bug#19657725
...@@ -1223,42 +1223,42 @@ SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH(" ...@@ -1223,42 +1223,42 @@ SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
SELECT SELECT
ST_LONGFROMGEOHASH( ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
SELECT SELECT
ST_LATFROMGEOHASH( ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ" CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci); AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1267,7 +1267,7 @@ SELECT ...@@ -1267,7 +1267,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci,
4326 4326
) )
); ) c;
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1276,7 +1276,7 @@ SELECT ...@@ -1276,7 +1276,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci,
4326 4326
) )
); ) c;
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1285,7 +1285,7 @@ SELECT ...@@ -1285,7 +1285,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci,
4326 4326
) )
); ) c;
SELECT SELECT
ST_ASTEXT( ST_ASTEXT(
...@@ -1294,7 +1294,7 @@ SELECT ...@@ -1294,7 +1294,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci, AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci,
4326 4326
) )
); ) c;
##################################################################### #####################################################################
# Bug#19383904 # Bug#19383904
...@@ -1405,7 +1405,7 @@ SELECT ST_GeoHash(ST_PointFromGeoHash('xkcd', 0), 4); ...@@ -1405,7 +1405,7 @@ SELECT ST_GeoHash(ST_PointFromGeoHash('xkcd', 0), 4);
SELECT ST_LongFromGeoHash('xkcd'); SELECT ST_LongFromGeoHash('xkcd');
SELECT ST_LatFromGeoHash('xkcd'); SELECT ST_LatFromGeoHash('xkcd');
SELECT ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4); SELECT ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4);
SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d'); SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d') c;
--echo # --echo #
--echo # Bug#22838668 CRASH IN ITEM_FUNC_LATLONGFROMGEOHASH::VAL_REAL --echo # Bug#22838668 CRASH IN ITEM_FUNC_LATLONGFROMGEOHASH::VAL_REAL
...@@ -1452,4 +1452,4 @@ INSERT INTO t1 VALUES ('bbbb'); ...@@ -1452,4 +1452,4 @@ INSERT INTO t1 VALUES ('bbbb');
SELECT ST_LatFromGeohash(col1) FROM t1; SELECT ST_LatFromGeohash(col1) FROM t1;
SELECT ST_LongFromGeohash(col1) FROM t1; SELECT ST_LongFromGeohash(col1) FROM t1;
SELECT ST_AsText(ST_PointFromGeohash(col1, 4326)) FROM t1; SELECT ST_AsText(ST_PointFromGeohash(col1, 4326)) FROM t1;
DROP TABLE t1; DROP TABLE t1;
\ No newline at end of file
...@@ -81,8 +81,8 @@ ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,0 0,0 0)')) ...@@ -81,8 +81,8 @@ ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,0 0,0 0)'))
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)'));
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)')) ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')) c
1 1
#==================================================================================== #====================================================================================
# linestring # linestring
...@@ -105,8 +105,8 @@ ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)')) ...@@ -105,8 +105,8 @@ ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'))
SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'));
ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')) ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')) c;
ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')) c
1 1
#==================================================================================== #====================================================================================
# multilinestring # multilinestring
...@@ -123,20 +123,20 @@ ST_ISVALID(g) ...@@ -123,20 +123,20 @@ ST_ISVALID(g)
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'));
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))')) ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 2),(3 3))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 2),(3 3))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 2),(3 3))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')) c
1 1
#==================================================================================== #====================================================================================
# polygon # polygon
...@@ -156,29 +156,29 @@ ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0))')) ...@@ -156,29 +156,29 @@ ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0))'))
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))'));
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))')) ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,-10 0,-10 -10,0 -10,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,-10 0,-10 -10,0 -10,0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,-10 0,-10 -10,0 -10,0 0))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(4 4,4 6,6 6,6 4,4 4))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(4 4,4 6,6 6,6 4,4 4))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(4 4,4 6,6 6,6 4,4 4))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(6 6,6 8,8 8,8 6,6 6))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(6 6,6 8,8 8,8 6,6 6))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(6 6,6 8,8 8,8 6,6 6))')) c
1 1
#==================================================================================== #====================================================================================
# multipolygon # multipolygon
...@@ -192,41 +192,41 @@ ST_ISVALID(g) ...@@ -192,41 +192,41 @@ ST_ISVALID(g)
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))'));
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))')) ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0,0 10)),((0 0,10 10,10 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0,0 10)),((0 0,10 10,10 0,0 0)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0,0 10)),((0 0,10 10,10 0,0 0)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4 4,4 6,6 6,6 4,4 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4 4,4 6,6 6,6 4,4 4,4 4)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4 4,4 6,6 6,6 4,4 4,4 4)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,4 4)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,4 4)))')) c
0 0
#==================================================================================== #====================================================================================
# geometrycollection # geometrycollection
...@@ -243,53 +243,48 @@ ST_ISVALID(g) ...@@ -243,53 +243,48 @@ ST_ISVALID(g)
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')) ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))'));
ERROR 22023: Invalid GIS data provided to function st_isvalid. ERROR 22023: Invalid GIS data provided to function st_isvalid.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10)))'));
ERROR 22023: Invalid GIS data provided to function st_isvalid. ERROR 22023: Invalid GIS data provided to function st_isvalid.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCOLLECTION())')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCOLLECTION())'));
ERROR 22023: Invalid GIS data provided to function st_isvalid. ERROR 22023: Invalid GIS data provided to function st_isvalid.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,1 1,2 2,0 0)),GEOMETRYCOLLECTION())')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,1 1,2 2,0 0)),GEOMETRYCOLLECTION())'));
ERROR 22023: Invalid GIS data provided to function st_isvalid. ERROR 22023: Invalid GIS data provided to function st_isvalid.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,10 10,20 20),POLYGON((0 0,10 10,100 100,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,10 10,20 20),POLYGON((0 0,10 10,100 100,0 0)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,10 10,20 20),POLYGON((0 0,10 10,100 100,0 0)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c
0 0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')); 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),' c
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10),' 'MULTIPOINT(0 0,10 10),'
'LINESTRING(1 1,2 2,3 3),' 'LINESTRING(1 1,2 2,3 3),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')); 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' c
'MULTIPOINT(0 0,10 10),'
'LINESTRING(1 1,2 2,3 3),'
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))')) c
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION('
'GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))))')); 'GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))))'));
ERROR 22023: Invalid GIS data provided to function st_isvalid. ERROR 22023: Invalid GIS data provided to function st_isvalid.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),'
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')); 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),' c
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))'))
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10)),' 'MULTIPOINT(0 0,10 10)),'
...@@ -314,16 +309,13 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),' ...@@ -314,16 +309,13 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),'
'POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),' 'POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),'
'MULTIPOINT(0 0,10 10),' 'MULTIPOINT(0 0,10 10),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)),' 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)),'
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')); 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),' c
'LINESTRING(1 1,2 2,3 3),'
'POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-7 -2,-9 3,-2 -8),(3 7,5 6,-7 -9,7 -1,-2 -8,2 9,4 6,-5 -5)),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-7 -2,-9 3,-2 -8),(3 7,5 6,-7 -9,7 -1,-2 -8,2 9,4 6,-5 -5)),'
'MULTILINESTRING((2 -2,2 -3,2 -1,-10 7,1 -2,-2 0,-9 -2,10 5,-7 -8,-9 -1,1 -1,-2 3,5 -9,-8 -9,-10 -9)),' 'MULTILINESTRING((2 -2,2 -3,2 -1,-10 7,1 -2,-2 0,-9 -2,10 5,-7 -8,-9 -1,1 -1,-2 3,5 -9,-8 -9,-10 -9)),'
'MULTIPOINT(-7 -5,6 9,7 4))')); 'MULTIPOINT(-7 -5,6 9,7 4))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-7 -2,-9 3,-2 -8),(3 7,5 6,-7 -9,7 -1,-2 -8,2 9,4 6,-5 -5)),' c
'MULTILINESTRING((2 -2,2 -3,2 -1,-10 7,1 -2,-2 0,-9 -2,10 5,-7 -8,-9 -1,1 -1
1 1
##################################################################################### #####################################################################################
# Invalid function calls # Invalid function calls
...@@ -386,8 +378,8 @@ ST_ISVALID(ST_GEOMFROMTEXT(@star_of_elems,4294967297)) ...@@ -386,8 +378,8 @@ ST_ISVALID(ST_GEOMFROMTEXT(@star_of_elems,4294967297))
SELECT ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000)); SELECT ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000));
ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000)) ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000))
0 0
SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000'); SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000') c;
ST_ISVALID( x'e6100000010100000000000000000000000000000000000000') c
1 1
# Clean up # Clean up
DROP TABLE gis_geometrycollection; DROP TABLE gis_geometrycollection;
...@@ -398,14 +390,10 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168 ...@@ -398,14 +390,10 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168
-167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054 -167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054
187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997 187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,49.8714768817168 135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,49.8714768817168
-176.0048853643874,72.8714768817168 -167.0048853643874))')); -176.0048853643874,72.8714768817168 -167.0048853643874))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168 c
-167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054
187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154
1 1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997 SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))')); 135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))')) c;
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997 c
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))'))
1 1
...@@ -104,7 +104,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,0 0,0 0)')); ...@@ -104,7 +104,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,0 0,0 0)'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # linestring --echo # linestring
...@@ -121,7 +121,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)')); ...@@ -121,7 +121,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # multilinestring --echo # multilinestring
...@@ -134,15 +134,15 @@ SELECT ST_ISVALID(g) FROM gis_geometrycollection WHERE fid=114; ...@@ -134,15 +134,15 @@ SELECT ST_ISVALID(g) FROM gis_geometrycollection WHERE fid=114;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 2),(3 3))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 2),(3 3))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # polygon --echo # polygon
...@@ -157,21 +157,21 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0))')); ...@@ -157,21 +157,21 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,-10 0,-10 -10,0 -10,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,-10 0,-10 -10,0 -10,0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(4 4,4 6,6 6,6 4,4 4))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(4 4,4 6,6 6,6 4,4 4))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(6 6,6 8,8 8,8 6,6 6))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,6 4,6 6,4 6,4 4),(6 6,6 8,8 8,8 6,6 6))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # multipolygon --echo # multipolygon
...@@ -182,29 +182,29 @@ SELECT ST_ISVALID(g) FROM gis_geometrycollection WHERE fid=103; ...@@ -182,29 +182,29 @@ SELECT ST_ISVALID(g) FROM gis_geometrycollection WHERE fid=103;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,0 0)))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0,0 10)),((0 0,10 10,10 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0,0 10)),((0 0,10 10,10 0,0 0)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(0 0,0 10,10 10,10 0,0 0)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((4 4,4 6,6 6,6 4,4 4,4 4),(8 8,8 10,10 10,10 8,8 8)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4 4,4 6,6 6,6 4,4 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),((4 4,4 6,6 6,6 4,4 4,4 4)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0),(0 0,0 10,10 10,10 0,0 0)),((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,4 4)))')) c;
--echo #==================================================================================== --echo #====================================================================================
--echo # geometrycollection --echo # geometrycollection
...@@ -217,17 +217,17 @@ SELECT ST_ISVALID(g) FROM gis_geometrycollection WHERE fid=115; ...@@ -217,17 +217,17 @@ SELECT ST_ISVALID(g) FROM gis_geometrycollection WHERE fid=115;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')) c;
--error ER_GIS_INVALID_DATA --error ER_GIS_INVALID_DATA
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')) c;
--error ER_GIS_INVALID_DATA --error ER_GIS_INVALID_DATA
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10)))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))')) c;
--error ER_GIS_INVALID_DATA --error ER_GIS_INVALID_DATA
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCOLLECTION())')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCOLLECTION())'));
...@@ -235,26 +235,26 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCO ...@@ -235,26 +235,26 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCO
--error ER_GIS_INVALID_DATA --error ER_GIS_INVALID_DATA
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,1 1,2 2,0 0)),GEOMETRYCOLLECTION())')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,1 1,2 2,0 0)),GEOMETRYCOLLECTION())'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,10 10,20 20),POLYGON((0 0,10 10,100 100,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,10 10,20 20),POLYGON((0 0,10 10,100 100,0 0)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(1 1,2 2,3 3),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')); 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10),' 'MULTIPOINT(0 0,10 10),'
'LINESTRING(1 1,2 2,3 3),' 'LINESTRING(1 1,2 2,3 3),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')); 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))')); SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))')) c;
--error ER_GIS_INVALID_DATA --error ER_GIS_INVALID_DATA
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION('
'GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))))')); 'GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),'
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')); 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')) c;
--error ER_GIS_INVALID_DATA --error ER_GIS_INVALID_DATA
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10)),' 'MULTIPOINT(0 0,10 10)),'
...@@ -279,11 +279,11 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),' ...@@ -279,11 +279,11 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),'
'POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),' 'POLYGON((0 0,0 10,10 10,10 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)),'
'MULTIPOINT(0 0,10 10),' 'MULTIPOINT(0 0,10 10),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)),' 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)),'
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')); 'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-7 -2,-9 3,-2 -8),(3 7,5 6,-7 -9,7 -1,-2 -8,2 9,4 6,-5 -5)),' SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((-7 -2,-9 3,-2 -8),(3 7,5 6,-7 -9,7 -1,-2 -8,2 9,4 6,-5 -5)),'
'MULTILINESTRING((2 -2,2 -3,2 -1,-10 7,1 -2,-2 0,-9 -2,10 5,-7 -8,-9 -1,1 -1,-2 3,5 -9,-8 -9,-10 -9)),' 'MULTILINESTRING((2 -2,2 -3,2 -1,-10 7,1 -2,-2 0,-9 -2,10 5,-7 -8,-9 -1,1 -1,-2 3,5 -9,-8 -9,-10 -9)),'
'MULTIPOINT(-7 -5,6 9,7 4))')); 'MULTIPOINT(-7 -5,6 9,7 4))')) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # Invalid function calls --echo # Invalid function calls
...@@ -363,7 +363,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000)); ...@@ -363,7 +363,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000));
# This is an example of a working wkb, first the SRID, specification it is # This is an example of a working wkb, first the SRID, specification it is
# littleendian, and is a point with coordinates (0,0) # littleendian, and is a point with coordinates (0,0)
SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000'); SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000') c;
--echo # Clean up --echo # Clean up
DROP TABLE gis_geometrycollection; DROP TABLE gis_geometrycollection;
...@@ -375,7 +375,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168 ...@@ -375,7 +375,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168
-167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054 -167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054
187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997 187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,49.8714768817168 135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,49.8714768817168
-176.0048853643874,72.8714768817168 -167.0048853643874))')); -176.0048853643874,72.8714768817168 -167.0048853643874))')) c;
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997 SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))')); 135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))')) c;
...@@ -68,409 +68,376 @@ POINT(-16 11) ...@@ -68,409 +68,376 @@ POINT(-16 11)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000)) ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000))
POINT(-5 -2) POINT(-5 -2)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890)) c
POINT(-10 6) POINT(-10 6)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111)) c
POINT(-16 -8) POINT(-16 -8)
##################################################################################### #####################################################################################
# ST_SIMPLIFY(multipoint) # ST_SIMPLIFY(multipoint)
##################################################################################### #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 -4, -2 -6, -8 2)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 -4, -2 -6, -8 2)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 -4, -2 -6, -8 2)'), 1)) c
MULTIPOINT(19 -4,-2 -6,-8 2) MULTIPOINT(19 -4,-2 -6,-8 2)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-3 14, 19 8, 10 -8)'), 2)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-3 14, 19 8, 10 -8)'), 2)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-3 14, 19 8, 10 -8)'), 2)) c
MULTIPOINT(-3 14,19 8,10 -8) MULTIPOINT(-3 14,19 8,10 -8)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(1 -8, -1 12, -11 16)'), 3)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(1 -8, -1 12, -11 16)'), 3)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(1 -8, -1 12, -11 16)'), 3)) c
MULTIPOINT(1 -8,-1 12,-11 16) MULTIPOINT(1 -8,-1 12,-11 16)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-16 11, -2 -7, -11 11)'), 4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-16 11, -2 -7, -11 11)'), 4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-16 11, -2 -7, -11 11)'), 4)) c
MULTIPOINT(-16 11,-2 -7,-11 11) MULTIPOINT(-16 11,-2 -7,-11 11)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 12, 0 9, 5 10, 20 -16, 7 -17, 9 -18, 19 -7)'), 10)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 12, 0 9, 5 10, 20 -16, 7 -17, 9 -18, 19 -7)'), 10)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 12, 0 9, 5 10, 20 -16, 7 -17, 9 -18, 19 -7)'), 10)) c
MULTIPOINT(19 12,0 9,5 10,20 -16,7 -17,9 -18,19 -7) MULTIPOINT(19 12,0 9,5 10,20 -16,7 -17,9 -18,19 -7)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-1 11, -17 -11, -15 16, 6 -6, 11 -13, -4 -12, -13 -5)'), 1000)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-1 11, -17 -11, -15 16, 6 -6, 11 -13, -4 -12, -13 -5)'), 1000)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-1 11, -17 -11, -15 16, 6 -6, 11 -13, -4 -12, -13 -5)'), 1000)) c
MULTIPOINT(-1 11,-17 -11,-15 16,6 -6,11 -13,-4 -12,-13 -5) MULTIPOINT(-1 11,-17 -11,-15 16,6 -6,11 -13,-4 -12,-13 -5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(17 -11, -19 -6, 5 17, -14 13, 20 13, 20 2, 0 -12)'), 200000)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(17 -11, -19 -6, 5 17, -14 13, 20 13, 20 2, 0 -12)'), 200000)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(17 -11, -19 -6, 5 17, -14 13, 20 13, 20 2, 0 -12)'), 200000)) c
MULTIPOINT(17 -11,-19 -6,5 17,-14 13,20 13,20 2,0 -12) MULTIPOINT(17 -11,-19 -6,5 17,-14 13,20 13,20 2,0 -12)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-15 12, 17 -12, -7 14, 1 6, 19 -10, 11 -9, 0 -17)'), 9999999)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-15 12, 17 -12, -7 14, 1 6, 19 -10, 11 -9, 0 -17)'), 9999999)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-15 12, 17 -12, -7 14, 1 6, 19 -10, 11 -9, 0 -17)'), 9999999)) c
MULTIPOINT(-15 12,17 -12,-7 14,1 6,19 -10,11 -9,0 -17) MULTIPOINT(-15 12,17 -12,-7 14,1 6,19 -10,11 -9,0 -17)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(3 -13, 18 -2, -5 -13, -12 1, 20 0, -6 14, 5 -4)'), 1234567890)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(3 -13, 18 -2, -5 -13, -12 1, 20 0, -6 14, 5 -4)'), 1234567890)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(3 -13, 18 -2, -5 -13, -12 1, 20 0, -6 14, 5 -4)'), 1234567890)) c
MULTIPOINT(3 -13,18 -2,-5 -13,-12 1,20 0,-6 14,5 -4) MULTIPOINT(3 -13,18 -2,-5 -13,-12 1,20 0,-6 14,5 -4)
##################################################################################### #####################################################################################
# ST_SIMPLIFY(linestring) # ST_SIMPLIFY(linestring)
##################################################################################### #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,10 10)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,10 10)'), 1)) c
LINESTRING(0 0,10 10) LINESTRING(0 0,10 10)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.5)) c
LINESTRING(0 0,5 0,5 5) LINESTRING(0 0,5 0,5 5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.6)) c
LINESTRING(0 0,5 5) LINESTRING(0 0,5 5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,4 4,6 -6,10 0)'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,4 4,6 -6,10 0)'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,4 4,6 -6,10 0)'), 5)) c
LINESTRING(0 0,4 4,6 -6,10 0) LINESTRING(0 0,4 4,6 -6,10 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.5)) c
LINESTRING(0 0,5 0,5 5,0 5,0 0) LINESTRING(0 0,5 0,5 5,0 5,0 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.6)) c
LINESTRING(0 0,5 5,0 0) LINESTRING(0 0,5 5,0 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 4.9)) c
LINESTRING(0 0,5 5,0 10,-5 5,0 0) LINESTRING(0 0,5 5,0 10,-5 5,0 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 5)) c
LINESTRING(0 0,0 10,0 0) LINESTRING(0 0,0 10,0 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,3 -3,5 5,7 -7,9 9,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,3 -3,5 5,7 -7,9 9,10 10)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,3 -3,5 5,7 -7,9 9,10 10)'), 1)) c
LINESTRING(0 0,1 1,3 -3,5 5,7 -7,10 10) LINESTRING(0 0,1 1,3 -3,5 5,7 -7,10 10)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.6)) c
LINESTRING(0 0,0 1,1 1,1 2,2 2,4 5,5 5) LINESTRING(0 0,0 1,1 1,1 2,2 2,4 5,5 5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.8)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.8)) c
LINESTRING(0 0,5 5) LINESTRING(0 0,5 5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 0.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 0.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 0.9)) c
LINESTRING(0 0,1 1,3 -1,5 1,7 -1,9 1,10 0) LINESTRING(0 0,1 1,3 -1,5 1,7 -1,9 1,10 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 1)) c
LINESTRING(0 0,10 0) LINESTRING(0 0,10 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.6)) c
LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0) LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.8)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.8)) c
LINESTRING(0 0,1 1,6 0,5 -1,0 0) LINESTRING(0 0,1 1,6 0,5 -1,0 0)
##################################################################################### #####################################################################################
# ST_SIMPLIFY(multilinestring) # ST_SIMPLIFY(multilinestring)
##################################################################################### #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10))'), 1)) c
MULTILINESTRING((0 0,10 10)) MULTILINESTRING((0 0,10 10))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.5)) c
MULTILINESTRING((0 0,10 10),(0 0,5 0,5 5)) MULTILINESTRING((0 0,10 10),(0 0,5 0,5 5))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.6)) c
MULTILINESTRING((0 0,10 10),(0 0,5 5)) MULTILINESTRING((0 0,10 10),(0 0,5 5))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.5)) c
MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0)) MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.6)) c
MULTILINESTRING((0 0,5 5),(0 0,5 5,0 0)) MULTILINESTRING((0 0,5 5),(0 0,5 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 4.9)) c
MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10)) MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 5)) c
MULTILINESTRING((0 0,0 10),(0 0,0 10)) MULTILINESTRING((0 0,0 10),(0 0,0 10))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)) c
MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0)) MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),'
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.6)); '(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' c
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.6))
MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,4 5,5 5),(0 0,1 0,1 1,2 1,4 4,5 4,4 4)) MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,4 5,5 5),(0 0,1 0,1 1,2 1,4 4,5 4,4 4))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),'
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.7)); '(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' c
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.7))
MULTILINESTRING((0 0,0 1,5 5),(0 0,1 0,1 1,5 4,4 4)) MULTILINESTRING((0 0,0 1,5 5),(0 0,1 0,1 1,5 4,4 4))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.6)) c
MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)) MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.8)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.8)) c
MULTILINESTRING((0 0,1 1,6 0),(6 0,5 -1,0 0)) MULTILINESTRING((0 0,1 1,6 0),(6 0,5 -1,0 0))
##################################################################################### #####################################################################################
# ST_SIMPLIFY(polygon) # ST_SIMPLIFY(polygon)
##################################################################################### #####################################################################################
# Invalid geometry in input. # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,4 4,6 -6,10 0,0 0,0 0,0 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,4 4,6 -6,10 0,0 0,0 0,0 0))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,4 4,6 -6,10 0,0 0,0 0,0 0))'), 5)) c
POLYGON((0 0,4 4,6 -6,10 0,0 0)) POLYGON((0 0,4 4,6 -6,10 0,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.5)) c
POLYGON((0 0,0 5,5 5,5 0,0 0)) POLYGON((0 0,0 5,5 5,5 0,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.6)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 14)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 14)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 14)) c
POLYGON((0 0,10 10,-10 10,0 0)) POLYGON((0 0,10 10,-10 10,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 15)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 15)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 15)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 4.9)) c
POLYGON((0 0,5 5,0 10,-5 5,0 0)) POLYGON((0 0,5 5,0 10,-5 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 5)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)) c
POLYGON((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0)) POLYGON((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 4.9)) c
POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0)) POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 5)) c
POLYGON((5 0,10 10,-10 10,-10 -10,10 -10,5 0)) POLYGON((5 0,10 10,-10 10,-10 -10,10 -10,5 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 12)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 12)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 12)) c
POLYGON((5 0,-10 10,-10 -10,5 0)) POLYGON((5 0,-10 10,-10 -10,5 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 17)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 17)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 17)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.4)) c
POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)) POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.5)) c
POLYGON((0 0,0 10,10 10,10 0,0 0)) POLYGON((0 0,0 10,10 10,10 0,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7)) c
POLYGON((0 0,0 10,10 10,10 0,0 0)) POLYGON((0 0,0 10,10 10,10 0,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7.1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7.1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7.1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 3)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 3)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 3)) c
POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2)) POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 4)) c
POLYGON((10 2,5 2,5 10,-5 10,-10 -2,-5 -2,-5 -10,5 -10,10 2)) POLYGON((10 2,5 2,5 10,-5 10,-10 -2,-5 -2,-5 -10,5 -10,10 2))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 5)) c
POLYGON((10 2,-5 10,-10 -2,5 -10,10 2)) POLYGON((10 2,-5 10,-10 -2,5 -10,10 2))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 11)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 11)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 11)) c
NULL NULL
##################################################################################### #####################################################################################
# ST_SIMPLIFY(multipolygon) # ST_SIMPLIFY(multipolygon)
##################################################################################### #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.5)) c
MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0))) MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.6)) c
NULL NULL
# Invalid geometry in input. # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)) c
MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0))) MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.4)) c
MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4))) MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(4 4,4 6,6 6,6 4,4 4)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.5)) c
MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0))) MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7)) c
MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0))) MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7.1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7.1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7.1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.4)) c
MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((4 4,4 6,6 6,6 4,4 4))) MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)),((4 4,4 6,6 6,6 4,4 4)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.5)) c
MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0))) MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7)) c
MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0))) MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7.1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7.1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7.1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)) c
MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0))) MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 14)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 14)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 14)) c
MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0))) MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 15)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 15)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 15)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)) c
MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0))) MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),'
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 3)); '((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 3)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),' c
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 3))
MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0))) MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),'
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 4)); '((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),' c
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 4))
NULL NULL
##################################################################################### #####################################################################################
# ST_SIMPLIFY(geometrycollection) # ST_SIMPLIFY(geometrycollection)
##################################################################################### #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)) c
GEOMETRYCOLLECTION(POINT(0 0)) GEOMETRYCOLLECTION(POINT(0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))'), 1)) c
GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2)) GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.5)) c
GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0)) GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.6)) c
GEOMETRYCOLLECTION(LINESTRING(0 0,5 5,0 0)) GEOMETRYCOLLECTION(LINESTRING(0 0,5 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0))'), 5)) c
GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0)) GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 4,4 4),(0 0,5 0,5 5,0 5,0 0)))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 4,4 4),(0 0,5 0,5 5,0 5,0 0)))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 4,4 4),(0 0,5 0,5 5,0 5,0 0)))'), 3.5)) c
GEOMETRYCOLLECTION(MULTILINESTRING((0 0,4 4),(0 0,5 0,5 5,0 5,0 0))) GEOMETRYCOLLECTION(MULTILINESTRING((0 0,4 4),(0 0,5 0,5 5,0 5,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 5,5 5),(0 0,5 0,5 5,0 5,0 0)))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 5,5 5),(0 0,5 0,5 5,0 5,0 0)))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 5,5 5),(0 0,5 0,5 5,0 5,0 0)))'), 3.6)) c
GEOMETRYCOLLECTION(MULTILINESTRING((0 0,5 5),(0 0,5 5,0 0))) GEOMETRYCOLLECTION(MULTILINESTRING((0 0,5 5),(0 0,5 5,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)) c
GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0))) GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,10 10,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)) c
GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0))) GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 7)) c
GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))) GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0))))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 8)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 8)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.5)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.6)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),' 'POINT(0 0),'
'LINESTRING(0 0,0 5,5 5,5 0,0 0),' 'LINESTRING(0 0,0 5,5 5,5 0,0 0),'
'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)); 'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(0 0),'
'LINESTRING(0 0,0 5,5 5,5 0,0 0),'
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,0 5,5 5,5 0,0 0),POLYGON((0 0,0 -5,-5 -5,-5 0,0 0))) GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,0 5,5 5,5 0,0 0),POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),' 'POINT(0 0),'
'LINESTRING(0 0,0 5,5 5,5 0,0 0),' 'LINESTRING(0 0,0 5,5 5,5 0,0 0),'
'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)); 'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(0 0),'
'LINESTRING(0 0,0 5,5 5,5 0,0 0),'
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,5 5,0 0)) GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,5 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),' 'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)); 'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9))
GEOMETRYCOLLECTION(LINESTRING(0 0,5 5,0 10,-5 5,0 0),POLYGON((0 0,-5 -5,0 -10,5 -5,0 0))) GEOMETRYCOLLECTION(LINESTRING(0 0,5 5,0 10,-5 5,0 0),POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),' 'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)); 'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5))
GEOMETRYCOLLECTION(LINESTRING(0 0,0 10,0 0)) GEOMETRYCOLLECTION(LINESTRING(0 0,0 10,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),' 'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),'
'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 4.9)); 'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 4.9)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),'
'MULTIPOLYGON(((0 0,5
GEOMETRYCOLLECTION(MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0)))) GEOMETRYCOLLECTION(MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),' 'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),'
'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 5)); 'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 5)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),'
'MULTIPOLYGON(((0 0,5
GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 10,0 0),(0 0,0 -10,0 0))) GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 10,0 0),(0 0,0 -10,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 1)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 0,0 -1,5 -1,0 -3,5 -3,0 -4,5 -4,0 0)) GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 0,0 -1,5 -1,0 -3,5 -3,0 -4,5 -4,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 2)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 2)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 0,0 -1,5 -3,0 -4,5 -4,0 0)) GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 0,0 -1,5 -3,0 -4,5 -4,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 3)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 3)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 0,0 -4,5 -4,0 0)) GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 0,0 -4,5 -4,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 4)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 -4,0 0)) GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,5 -4,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 7)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 7)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,0 0)) GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),LINESTRING(0 0,0 0))
# Invalid geometry in input. # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -479,11 +446,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -479,11 +446,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 1)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,2.5 2.5,-2.5 7.5,0 10),POLYGON((0 0,5 0,0 -1,5 -1,0 -3,5 -3,0 -4,5 -4,0 0)),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0)))) GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,2.5 2.5,-2.5 7.5,0 10),POLYGON((0 0,5 0,0 -1,5 -1,0 -3,5 -3,0 -4,5 -4,0 0)),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))
# Invalid geometry in input. # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -492,11 +456,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -492,11 +456,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 2)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 2)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,2.5 2.5,-2.5 7.5,0 10),POLYGON((0 0,5 0,0 -1,5 -3,0 -4,5 -4,0 0)),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0)))) GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,2.5 2.5,-2.5 7.5,0 10),POLYGON((0 0,5 0,0 -1,5 -3,0 -4,5 -4,0 0)),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))
# Invalid geometry in input. # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -505,11 +466,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -505,11 +466,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 3)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 3)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,0 10),POLYGON((0 0,5 0,0 -4,5 -4,0 0)),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,0 0),(0 0,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0)))) GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,0 10),POLYGON((0 0,5 0,0 -4,5 -4,0 0)),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,0 0),(0 0,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))
# Invalid geometry in input. # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -518,11 +476,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -518,11 +476,8 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 4)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 4)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' c
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,0 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,0 0),(0 0,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0))) GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,0 10),MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),MULTILINESTRING((0 0,0 0),(0 0,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)))
##################################################################################### #####################################################################################
# ST_ASTEXT(ST_SIMPLIFY(geometry) with different SRID values # ST_ASTEXT(ST_SIMPLIFY(geometry) with different SRID values
...@@ -560,8 +515,8 @@ NULL ...@@ -560,8 +515,8 @@ NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1)) ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1))
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 1)) ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 1))
...@@ -577,27 +532,27 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp ...@@ -577,27 +532,27 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1)) ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1))
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'), 1));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10)'), 1))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10)'), 1))' at line 1
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'), 1));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10,10 0,0 0))'), 1))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '!' 0,10 10,10 0,0 0))'), 1))' at line 1
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'), 1)) c;
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'), 1)) c
NULL NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0))'), 0)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0))'), 0));
ERROR HY000: Incorrect arguments to st_simplify ERROR HY000: Incorrect arguments to st_simplify
......
...@@ -92,292 +92,292 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 11)'), 1000)); ...@@ -92,292 +92,292 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 11)'), 1000));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_SIMPLIFY(multipoint) --echo # ST_SIMPLIFY(multipoint)
--echo ##################################################################################### --echo #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 -4, -2 -6, -8 2)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 -4, -2 -6, -8 2)'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-3 14, 19 8, 10 -8)'), 2)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-3 14, 19 8, 10 -8)'), 2)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(1 -8, -1 12, -11 16)'), 3)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(1 -8, -1 12, -11 16)'), 3)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-16 11, -2 -7, -11 11)'), 4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-16 11, -2 -7, -11 11)'), 4)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 12, 0 9, 5 10, 20 -16, 7 -17, 9 -18, 19 -7)'), 10)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 12, 0 9, 5 10, 20 -16, 7 -17, 9 -18, 19 -7)'), 10)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-1 11, -17 -11, -15 16, 6 -6, 11 -13, -4 -12, -13 -5)'), 1000)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-1 11, -17 -11, -15 16, 6 -6, 11 -13, -4 -12, -13 -5)'), 1000)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(17 -11, -19 -6, 5 17, -14 13, 20 13, 20 2, 0 -12)'), 200000)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(17 -11, -19 -6, 5 17, -14 13, 20 13, 20 2, 0 -12)'), 200000)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-15 12, 17 -12, -7 14, 1 6, 19 -10, 11 -9, 0 -17)'), 9999999)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-15 12, 17 -12, -7 14, 1 6, 19 -10, 11 -9, 0 -17)'), 9999999)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(3 -13, 18 -2, -5 -13, -12 1, 20 0, -6 14, 5 -4)'), 1234567890)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(3 -13, 18 -2, -5 -13, -12 1, 20 0, -6 14, 5 -4)'), 1234567890)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_SIMPLIFY(linestring) --echo # ST_SIMPLIFY(linestring)
--echo ##################################################################################### --echo #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,10 10)'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,4 4,6 -6,10 0)'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,4 4,6 -6,10 0)'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5,0 5,0 0)'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,0 10,-5 5,0 0)'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,3 -3,5 5,7 -7,9 9,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,3 -3,5 5,7 -7,9 9,10 10)'), 1)) c;
# TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM # TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM
# SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.5)); # SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.6)) c;
# TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM # TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM
# SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.7)); # SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5)'), 0.8)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 0.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 0.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 -1,4 0,5 1,6 0,7 -1,8 0,9 1,10 0)'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.6)) c;
# TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM # TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM
# SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.7)); # SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,1 1,2 0,3 1,4 0,5 1,6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0)'), 0.8)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_SIMPLIFY(multilinestring) --echo # ST_SIMPLIFY(multilinestring)
--echo ##################################################################################### --echo #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10),(0 0,5 0,5 5))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,5 5),(0 0,5 0,5 5,0 5,0 0))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,0 10),(0 0,-5 5,0 10))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)) c;
# TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM # TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM
# SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' # SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),'
# '(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.5)); # '(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),'
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.6)); '(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 1,1 1,1 2,2 2,2 3,3 3,3 4,4 4,4 5,5 5),'
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.7)); '(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.6)) c;
# TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM # TODO Bug #33739281 Some gis functions give different results with gcc11 in optimized mode on ARM
# SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.7)); # SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 0,3 1,4 0,5 1,6 0),(6 0,5 -1,4 0,3 -1,2 0,1 -1,0 0))'), 0.8)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_SIMPLIFY(polygon) --echo # ST_SIMPLIFY(polygon)
--echo ##################################################################################### --echo #####################################################################################
--echo # Invalid geometry in input. --echo # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,4 4,6 -6,10 0,0 0,0 0,0 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,4 4,6 -6,10 0,0 0,0 0,0 0))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,5 0,0 0))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 14)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 14)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 15)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 15)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 12)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 12)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 17)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((5 0,10 10,-10 10,-5 0,-10 -10,10 -10,5 0))'), 17)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.4)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 1.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7.1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4))'), 7.1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 3)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 3)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 4)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 11)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((10 2,5 2,5 10,-5 10,-5 2,-10 2,-10 -2,-5 -2,-5 -10,5 -10,5 -2,10 -2,10 2))'), 11)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_SIMPLIFY(multipolygon) --echo # ST_SIMPLIFY(multipolygon)
--echo ##################################################################################### --echo #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.6)) c;
--echo # Invalid geometry in input. --echo # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.4)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 1.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7.1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0),(4 4,4 6,6 6,6 4,4 4)))'), 7.1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.4)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.4)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 1.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7.1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((4 4,4 6,6 6,6 4,4 4,4 4,4 4,4 4)))'), 7.1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 14)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 14)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 15)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 10,-10 10,0 0)),((0 0,-10 -10,10 -10,0 0)))'), 15)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,5 5,0 10,-5 5,0 0)),((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),'
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 3)); '((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 3)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,4 6,0 10,-4 6,0 0)),((0 0,-6 4,-10 0,-6 -4,0 0)),'
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 4)); '((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 4)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_SIMPLIFY(geometrycollection) --echo # ST_SIMPLIFY(geometrycollection)
--echo ##################################################################################### --echo #####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,5 0,5 5,0 5,0 0))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0))'), 5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0,4 4,6 -6,10 0))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 4,4 4),(0 0,5 0,5 5,0 5,0 0)))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 4,4 4),(0 0,5 0,5 5,0 5,0 0)))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 5,5 5),(0 0,5 0,5 5,0 5,0 0)))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 5,5 5),(0 0,5 0,5 5,0 5,0 0)))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTILINESTRING((0 0,1 1,3 -3,5 5,7 -7,9 9,10 10,0 0)))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)),((0 0,0 -8,-8 -8,-8 0,0 0))))'), 8)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.5)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.6)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 7)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0)))'), 8)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),' 'POINT(0 0),'
'LINESTRING(0 0,0 5,5 5,5 0,0 0),' 'LINESTRING(0 0,0 5,5 5,5 0,0 0),'
'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)); 'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),' 'POINT(0 0),'
'LINESTRING(0 0,0 5,5 5,5 0,0 0),' 'LINESTRING(0 0,0 5,5 5,5 0,0 0),'
'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)); 'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),' 'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)); 'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),' 'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)); 'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),' 'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),'
'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 4.9)); 'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 4.9)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),' 'MULTILINESTRING((0 0,5 5,0 10,-5 5,0 0),(0 0,-5 -5,0 -10,5 -5,0 0)),'
'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 5)); 'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 1)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 2)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 2)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 3)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 3)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 4)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 4)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(10 10),' 'POINT(10 10),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 7)); 'LINESTRING(0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 7)) c;
--echo # Invalid geometry in input. --echo # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -386,7 +386,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -386,7 +386,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 1)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 1)) c;
--echo # Invalid geometry in input. --echo # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -395,7 +395,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -395,7 +395,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 2)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 2)) c;
--echo # Invalid geometry in input. --echo # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -404,7 +404,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -404,7 +404,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 3)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 3)) c;
--echo # Invalid geometry in input. --echo # Invalid geometry in input.
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
...@@ -413,7 +413,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(' ...@@ -413,7 +413,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),' 'POLYGON((0 0,5 0,0 -1,5 -1,0 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0)),'
'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),' 'MULTIPOINT(0 0,1 1,2 2,3 3,4 4,5 5),'
'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),' 'MULTILINESTRING((0 0,1 1,-1 1,0 0),(0 0,2 2,-2 2,0 0),(0 0,3 3,-3 3,0 0),(0 0,4 4,-4 4,0 0)),'
'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 4)); 'MULTIPOLYGON(((0 0,2.5 2.5,-2.5 2.5,0 0)),((0 0,-2.5 -2.5,2.5 -2.5,0 0))))'), 4)) c;
--echo ##################################################################################### --echo #####################################################################################
--echo # ST_ASTEXT(ST_SIMPLIFY(geometry) with different SRID values --echo # ST_ASTEXT(ST_SIMPLIFY(geometry) with different SRID values
...@@ -453,7 +453,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON(())'), 1)); ...@@ -453,7 +453,7 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON(())'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 1));
...@@ -466,23 +466,23 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT('!' 0)'), 1)); ...@@ -466,23 +466,23 @@ SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT('!' 0)'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1)) c;
--error ER_PARSE_ERROR --error ER_PARSE_ERROR
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING('!' 0,10 10)'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'), 1)) c;
--error ER_PARSE_ERROR --error ER_PARSE_ERROR
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON(('!' 0,10 10,10 0,0 0))'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'), 1)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'), 1)) c;
--error ER_WRONG_ARGUMENTS --error ER_WRONG_ARGUMENTS
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0))'), 0)); SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0,0 0,0 0))'), 0));
......
...@@ -17,29 +17,26 @@ ERROR 22023: Invalid GIS data provided to function st_validate. ...@@ -17,29 +17,26 @@ ERROR 22023: Invalid GIS data provided to function st_validate.
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)'))) ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)')))
POINT(15 25) POINT(15 25)
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT(5 0,25 0,15 10,15 25)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT(5 0,25 0,15 10,15 25)'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT(5 0,25 0,15 10,15 25)'))) c
MULTIPOINT(5 0,25 0,15 10,15 25) MULTIPOINT(5 0,25 0,15 10,15 25)
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)'))) c
LINESTRING(10 15,20 15) LINESTRING(10 15,20 15)
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((25 0,0 15,15 30,0 5))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((25 0,0 15,15 30,0 5))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((25 0,0 15,15 30,0 5))'))) c
MULTILINESTRING((25 0,0 15,15 30,0 5)) MULTILINESTRING((25 0,0 15,15 30,0 5))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))'))) c
POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0)) POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))'))) c
MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10))) MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10),' 'MULTIPOINT(0 0,10 10),'
'LINESTRING(1 1,2 2,3 3),' 'LINESTRING(1 1,2 2,3 3),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))'))); 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' c
'MULTIPOINT(0 0,10 10),'
'LINESTRING(1 1,2 2,3 3),'
GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10),LINESTRING(1 1,2 2,3 3),MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10))) GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10),LINESTRING(1 1,2 2,3 3),MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))
# The only valid empty geometry is the empty geometrycollection # The only valid empty geometry is the empty geometrycollection
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT()'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT()')));
...@@ -57,37 +54,37 @@ NULL ...@@ -57,37 +54,37 @@ NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())'))) ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())')))
NULL NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))'))) c
NULL NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))) ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')))
GEOMETRYCOLLECTION EMPTY GEOMETRYCOLLECTION EMPTY
# Invalid geometries return null # Invalid geometries return null
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'))) c
NULL NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))) c
NULL NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))'))) ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))')))
NULL NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))'))) c
NULL NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))) c
NULL NULL
# If a polygon or multipolygon has counterclockwise internal rings, the rings are returned counterclockwise # If a polygon or multipolygon has counterclockwise internal rings, the rings are returned counterclockwise
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))'))) c
POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,1 2,2 2,2 1,1 1)) POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,1 2,2 2,2 1,1 1))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))) c
MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,1 2,2 2,2 1,1 1))) MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(1 1,1 2,2 2,2 1,1 1)))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))) c;
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))) c
GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,1 2,2 2,2 1,1 1))) GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,1 2,2 2,2 1,1 1)))
# ST_VALIDATE raises an error if longitude is out of range # ST_VALIDATE raises an error if longitude is out of range
SELECT ST_VALIDATE(ST_GEOMFROMTEXT('POINT(0 270)', 4326)); SELECT ST_VALIDATE(ST_GEOMFROMTEXT('POINT(0 270)', 4326));
......
...@@ -33,15 +33,15 @@ SELECT ST_VALIDATE( x'00000000DEADBEEF'); ...@@ -33,15 +33,15 @@ SELECT ST_VALIDATE( x'00000000DEADBEEF');
--echo # ST_VALIDATE return the input if it is valid --echo # ST_VALIDATE return the input if it is valid
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)')));
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT(5 0,25 0,15 10,15 25)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT(5 0,25 0,15 10,15 25)'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((25 0,0 15,15 30,0 5))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((25 0,0 15,15 30,0 5))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((5 0,7 10,0 15,10 15,15 25,20 15,30 15,22 10,25 0,15 5,5 0))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),' SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10),' 'MULTIPOINT(0 0,10 10),'
'LINESTRING(1 1,2 2,3 3),' 'LINESTRING(1 1,2 2,3 3),'
'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))'))); 'MULTILINESTRING((0 0,0 10,10 10,10 0),(10 10,10 15,15 15,10 10)))'))) c;
--echo # The only valid empty geometry is the empty geometrycollection --echo # The only valid empty geometry is the empty geometrycollection
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT()'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT()')));
...@@ -49,20 +49,20 @@ SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT()'))); ...@@ -49,20 +49,20 @@ SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT()')));
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING()'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING()')));
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING(())'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING(())')));
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())')));
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')));
--echo # Invalid geometries return null --echo # Invalid geometries return null
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))')));
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))) c;
--echo # If a polygon or multipolygon has counterclockwise internal rings, the rings are returned counterclockwise --echo # If a polygon or multipolygon has counterclockwise internal rings, the rings are returned counterclockwise
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))); SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 2 1, 2 2, 1 2, 1 1)))'))) c;
--echo # ST_VALIDATE raises an error if longitude is out of range --echo # ST_VALIDATE raises an error if longitude is out of range
--error ER_LONGITUDE_OUT_OF_RANGE --error ER_LONGITUDE_OUT_OF_RANGE
......
...@@ -2780,7 +2780,7 @@ double Item_func_sphere_distance::spherical_distance_points(Geometry *g1, ...@@ -2780,7 +2780,7 @@ double Item_func_sphere_distance::spherical_distance_points(Geometry *g1,
} }
String *Item_func_geohash::val_str(String *str) String *Item_func_geohash::val_str_ascii(String *str)
{ {
DBUG_ASSERT(fixed()); DBUG_ASSERT(fixed());
double latitude, longitude; double latitude, longitude;
......
...@@ -1279,7 +1279,7 @@ class Item_func_sphere_distance: public Item_real_func ...@@ -1279,7 +1279,7 @@ class Item_func_sphere_distance: public Item_real_func
}; };
class Item_func_geohash: public Item_geometry_func class Item_func_geohash: public Item_str_ascii_checksum_func
{ {
void encode_geohash(String *str, double longitude, double latitude, void encode_geohash(String *str, double longitude, double latitude,
uint length); uint length);
...@@ -1291,22 +1291,28 @@ class Item_func_geohash: public Item_geometry_func ...@@ -1291,22 +1291,28 @@ class Item_func_geohash: public Item_geometry_func
public: public:
Item_func_geohash(THD *thd, Item *point, Item *max_length): Item_func_geohash(THD *thd, Item *point, Item *max_length):
Item_geometry_func(thd, point, max_length) {} Item_str_ascii_checksum_func(thd, point, max_length) {}
Item_func_geohash(THD *thd, Item *longitude, Item *latitude, Item_func_geohash(THD *thd, Item *longitude, Item *latitude,
Item *max_length): Item *max_length):
Item_geometry_func(thd, longitude, latitude, max_length) {} Item_str_ascii_checksum_func(thd, longitude, latitude, max_length) {}
bool fix_length_and_dec(THD *thd) override
{
fix_length_and_charset(UINT_MAX32, default_charset());
return FALSE;
}
LEX_CSTRING func_name_cstring() const override LEX_CSTRING func_name_cstring() const override
{ {
static LEX_CSTRING name= {STRING_WITH_LEN("st_geohash") }; static LEX_CSTRING name= {STRING_WITH_LEN("st_geohash") };
return name; return name;
} }
String *val_str(String *) override; String *val_str_ascii(String *) override;
Item *do_get_copy(THD *thd) const override Item *do_get_copy(THD *thd) const override
{ return get_item_copy<Item_func_geohash>(thd, this); } { return get_item_copy<Item_func_geohash>(thd, this); }
}; };
class Item_func_latlongfromgeohash : public Item_real_func { class Item_func_latlongfromgeohash : public Item_real_func
{
private: private:
String buf; String buf;
static const uint8_t geohash_alphabet[256]; static const uint8_t geohash_alphabet[256];
......
...@@ -105,6 +105,8 @@ class Item_str_ascii_checksum_func: public Item_str_ascii_func ...@@ -105,6 +105,8 @@ class Item_str_ascii_checksum_func: public Item_str_ascii_func
:Item_str_ascii_func(thd, a) { } :Item_str_ascii_func(thd, a) { }
Item_str_ascii_checksum_func(THD *thd, Item *a, Item *b) Item_str_ascii_checksum_func(THD *thd, Item *a, Item *b)
:Item_str_ascii_func(thd, a, b) { } :Item_str_ascii_func(thd, a, b) { }
Item_str_ascii_checksum_func(THD *thd, Item *a, Item *b, Item *c)
:Item_str_ascii_func(thd, a, b, c) { }
bool eq(const Item *item, bool binary_cmp) const override bool eq(const Item *item, bool binary_cmp) const override
{ {
// Always use binary argument comparison: MD5('x') != MD5('X') // Always use binary argument comparison: MD5('x') != MD5('X')
......
...@@ -2119,7 +2119,7 @@ class Item_func_group_concat : public Item_sum ...@@ -2119,7 +2119,7 @@ class Item_func_group_concat : public Item_sum
}; };
class Item_func_collect :public Item_sum_int class Item_func_collect :public Item_sum_int // XXX why *int* ???
{ {
uint32 srid; uint32 srid;
bool has_cached_result; bool has_cached_result;
...@@ -2140,15 +2140,17 @@ class Item_func_collect :public Item_sum_int ...@@ -2140,15 +2140,17 @@ class Item_func_collect :public Item_sum_int
Item_func_collect(THD *thd, bool is_distinct, Item *item_par); Item_func_collect(THD *thd, bool is_distinct, Item *item_par);
Item_func_collect(THD *thd, bool is_distinct, Item_func_collect *item); Item_func_collect(THD *thd, bool is_distinct, Item_func_collect *item);
bool fix_length_and_dec(THD *thd) override
{
Item_sum_int::fix_length_and_dec(thd);
base_flags|= item_base_t::MAYBE_NULL;
return false;
}
enum Sumfunctype sum_func () const override enum Sumfunctype sum_func () const override
{ {
return GEOMETRY_COLLECT_FUNC; return GEOMETRY_COLLECT_FUNC;
} }
void no_rows_in_result() override {; } void no_rows_in_result() override {; }
void make_const(longlong count_arg)
{
Item_sum_int::make_const();
}
const Type_handler *type_handler() const override const Type_handler *type_handler() const override
{ return &type_handler_string; } { return &type_handler_string; }
longlong val_int() override { return 0; } longlong val_int() override { return 0; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment