Commit d551c922 authored by Sergei Golubchik's avatar Sergei Golubchik

GIS fixes for --view

parent dd040b5c
......@@ -5534,14 +5534,14 @@ SELECT ST_ISVALID(@g);
ST_ISVALID(@g)
1
# 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))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0, 0 2, 2 2, 1 1, 2 0, 0 0))'));
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;
c
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;
a
......
......@@ -3536,11 +3536,11 @@ SELECT ST_ISVALID(@g);
--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;
......
......@@ -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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_center))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)'));
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)'))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(0 0)')) c;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)'));
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)'))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POINT(10 0)')) c;
c
0
#====================================================================================
# point,multipoint
......@@ -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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_bottom_points))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)'));
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)'))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0)')) c;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,10 0)'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,5 0,10 0)'));
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;
c
0
#====================================================================================
# point,linestring
......@@ -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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_top_to_center))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0,20 0)'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 0)'));
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;
c
0
#====================================================================================
# point,multilinestring
......@@ -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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_lines_near_vertical))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,10 0))'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(10 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0,10 0))'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 0)'),ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 0),(5 0,10 0))'));
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;
c
0
#====================================================================================
# point,polygon
......@@ -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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 0)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))'));
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;
c
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))'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('POLYGON((0 0,10 0,10 10,0 10,0 0))'));
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;
c
0
#====================================================================================
# point,multipolygon
......@@ -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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
0
#====================================================================================
# point,geometrycollection
......@@ -321,20 +321,20 @@ MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_collection_elems))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_top),ST_GEOMFROMTEXT(@star_collection_multilinestr))
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'));
MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())')) c;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(5 5))'));
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;
c
1
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(5 5)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,5 5,10 10),GEOMETRYCOLLECTION())'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(0 0)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(20 20)'),ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POLYGON((0 0,10 0,10 10,0 10,0 0))))'));
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;
c
NULL
#====================================================================================
# multipoint,point
......@@ -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));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_line_horizontal),ST_GEOMFROMTEXT(@star_of_elems_3))
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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((11 15,19 15,11 15)),((25 0,0 15,25 0)))'))
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;
c
1
#====================================================================================
# linestring,geometrycollection
......@@ -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));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_lines_near_vertical),ST_GEOMFROMTEXT(@star_lines_near_horizontal_3))
0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) FROM gis_geometrycollection WHERE fid=114;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))'))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTILINESTRING((0 5,15 25,0 15))')) c FROM gis_geometrycollection WHERE fid=114;
c
1
#====================================================================================
# multilinestring,polygon
......@@ -759,11 +759,11 @@ MBRCOVEREDBY(ST_GEOMFROMTEXT(@star),ST_GEOMFROMTEXT(@star_elem_vertical))
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star))
1
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) FROM gis_geometrycollection WHERE fid=100;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))'))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 0,25 5,30 0,25 0))')) c FROM gis_geometrycollection WHERE fid=100;
c
0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) FROM gis_geometrycollection WHERE fid=100;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))'))
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT('POLYGON((25 15,25 20,30 15,25 15))')) c FROM gis_geometrycollection WHERE fid=100;
c
0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical)) FROM gis_geometrycollection WHERE fid=400;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_elem_vertical))
......@@ -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));
MBRCOVEREDBY(ST_GEOMFROMTEXT(@star_elem_vertical),ST_GEOMFROMTEXT(@star_of_elems))
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;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT('MULTIPOLYGON(((25 0,25 5,30 0,25 0)),((25 15,25 20,30 15,25 15)))'))
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;
c
0
SELECT MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems)) FROM gis_geometrycollection WHERE fid=300;
MBRCOVEREDBY(g,ST_GEOMFROMTEXT(@star_of_elems))
......@@ -1104,41 +1104,41 @@ SELECT MBRCOVEREDBY(fid,ST_GEOMFROMTEXT(@star_top)) FROM gis_geometrycollection,
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;
ERROR HY000: Illegal parameter data type int for operation 'mbrcoveredby'
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(a 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(! 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
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
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POINT(12,34 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
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
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
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
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
SELECT MBRCOVEREDBY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0)'),ST_GEOMFROMTEXT('LINESTRING(0 0,10 10)'));
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;
c
NULL
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
......@@ -1156,29 +1156,20 @@ DROP TABLE gis_geometrycollection_2;
SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 0),
ST_GEOMFROMTEXT('POINT(0 0)', 0)
);
MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 0),
ST_GEOMFROMTEXT('POINT(0 0)', 0)
)
) c;
c
1
# Projected SRS (should pass)
SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 2000),
ST_GEOMFROMTEXT('POINT(0 0)', 2000)
);
MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 2000),
ST_GEOMFROMTEXT('POINT(0 0)', 2000)
)
) c;
c
1
# Geographic SRS (should pass)
SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 4326),
ST_GEOMFROMTEXT('POINT(0 0)', 4326)
);
MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 4326),
ST_GEOMFROMTEXT('POINT(0 0)', 4326)
)
) c;
c
1
......@@ -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(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 # point,multipoint
......@@ -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(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 # point,linestring
......@@ -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(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 # point,multilinestring
......@@ -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(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 # point,polygon
......@@ -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(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 # point,multipolygon
......@@ -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(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 # point,geometrycollection
......@@ -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('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 # multipoint,point
......@@ -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(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 # linestring,geometrycollection
......@@ -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(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 # multilinestring,polygon
......@@ -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(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;
......@@ -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(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;
......@@ -901,34 +901,34 @@ SELECT MBRCOVEREDBY(fid,ST_GEOMFROMTEXT(@star_top)) FROM gis_geometrycollection,
--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('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
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
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
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
SELECT MBRCOVEREDBY(,);
......@@ -951,16 +951,16 @@ DROP TABLE gis_geometrycollection_2;
SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 0),
ST_GEOMFROMTEXT('POINT(0 0)', 0)
);
) c;
--echo # Projected SRS (should pass)
SELECT MBRCOVEREDBY(
ST_GEOMFROMTEXT('POINT(0 0)', 2000),
ST_GEOMFROMTEXT('POINT(0 0)', 2000)
);
) c;
--echo # Geographic SRS (should pass)
SELECT MBRCOVEREDBY(
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
# result shall be 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2
0,3 0) ',4326));
ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 0,1 0,2
0,3 0) ',4326))
0,3 0) ',4326)) c;
c
1
SELECT ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3
0) ',4326));
ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM
table_simple_aggregation) , ST_GEOMFROMTEXT('MULTIPOINT(0 0,1 0,2 0,3
0) ',4326))
0) ',4326)) c;
c
1
INSERT INTO table_simple_aggregation (location) VALUES
( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)),
......@@ -33,35 +29,30 @@ INSERT INTO table_simple_aggregation (location) VALUES
# the result here shall be 1
SELECT ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM
table_simple_aggregation), ST_GEOMFROMTEXT('GEOMETRYCOLLECTION( MULTIPOINT(0
0,1 0,3 0), MULTIPOINT(2 0,0 0), POINT(0 0))',4326));
ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM
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;
c
1
# F-1 ST_COLLECT SHALL only return NULL if all elements are NULL or the
# aggregate is empty.
# as only a null is aggregated the result of the subquery shall be NULL
# and the result of the whole query shall be 1
SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
location = NULL) IS NULL;
(SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
location = NULL) IS NULL
location = NULL) IS NULL c;
c
1
# as no element is aggregated the result of the subquery shall be NULL
# and the result of the whole query shall be 1
SELECT (SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
st_srid(location)=2110) IS NULL;
(SELECT ST_COLLECT(location) AS t FROM table_simple_aggregation WHERE
st_srid(location)=2110) IS NULL
st_srid(location)=2110) IS NULL c;
c
1
INSERT INTO table_simple_aggregation (location) VALUES
( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)),
( NULL),
( NULL);
SELECT ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND
CURRENT ROW)) FROM table_simple_aggregation;
ST_ASTEXT(ST_COLLECT(location) OVER ( ROWS BETWEEN 1 PRECEDING AND
CURRENT ROW))
CURRENT ROW)) c FROM table_simple_aggregation;
c
MULTIPOINT(0 0)
MULTIPOINT(0 0,0 0)
MULTIPOINT(0 0,1 0)
......
......@@ -32,12 +32,12 @@ INSERT INTO table_simple_aggregation ( grouping_condition, location ) VALUES
--echo # result shall be 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( location ) AS t FROM
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 # result shall be 1
SELECT ST_EQUALS( (SELECT ST_COLLECT( DISTINCT location ) AS t FROM
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 # is given by aggregation machinery
# --echo # result shall be
......@@ -61,24 +61,24 @@ INSERT INTO table_simple_aggregation (location) VALUES
--echo # the result here shall be 1
SELECT ST_EQUALS((SELECT ST_COLLECT(LOCATION) AS T FROM
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 # aggregate is empty.
--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
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 # and the result of the whole query shall be 1
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
( ST_GEOMFROMTEXT('POINT(0 -0)' ,4326)),
( NULL),
( NULL);
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.
......
......@@ -184,31 +184,23 @@ ERROR 42S22: Unknown column 'abcdef' in 'field list'
# very long geohash
SELECT ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm"
"npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567"
"89bcdefghjkmnpqrstuvwxyz");
ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm"
"npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567"
"89bcdefghjkmnpqrstuvwxyz")
"89bcdefghjkmnpqrstuvwxyz") c;
c
-179.55743439816956
SELECT ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM"
"NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567"
"89BCDEFGHJKMNPQRSTUVWXYZ");
ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM"
"NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567"
"89BCDEFGHJKMNPQRSTUVWXYZ")
"89BCDEFGHJKMNPQRSTUVWXYZ") c;
c
-179.55743439816956
SELECT ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed"
"cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts"
"rqpnmkjhgfedcb9876543210");
ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed"
"cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts"
"rqpnmkjhgfedcb9876543210")
"rqpnmkjhgfedcb9876543210") c;
c
179.55743439816956
SELECT ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED"
"CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS"
"RQPNMKJHGFEDCB9876543210");
ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED"
"CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS"
"RQPNMKJHGFEDCB9876543210")
"RQPNMKJHGFEDCB9876543210") c;
c
179.55743439816956
CREATE TABLE geohashes (gid INT NOT NULL PRIMARY KEY, hash_value VARCHAR(255));
INSERT INTO geohashes VALUES
......@@ -435,31 +427,23 @@ ERROR 42S22: Unknown column 'abcdef' in 'field list'
# very long geohash
SELECT ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn"
"pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789"
"bcdefghjkmnpqrstuvwxyz");
ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn"
"pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789"
"bcdefghjkmnpqrstuvwxyz")
"bcdefghjkmnpqrstuvwxyz") c;
c
-82.77450549262497
SELECT ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN"
"PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789"
"BCDEFGHJKMNPQRSTUVWXYZ");
ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN"
"PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789"
"BCDEFGHJKMNPQRSTUVWXYZ")
"BCDEFGHJKMNPQRSTUVWXYZ") c;
c
-82.77450549262497
SELECT ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc"
"b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq"
"pnmkjhgfedcb9876543210");
ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc"
"b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq"
"pnmkjhgfedcb9876543210")
"pnmkjhgfedcb9876543210") c;
c
82.77450549262497
SELECT ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC"
"B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ"
"PNMKJHGFEDCB9876543210");
ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC"
"B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ"
"PNMKJHGFEDCB9876543210")
"PNMKJHGFEDCB9876543210") c;
c
82.77450549262497
# different random geohash values
SELECT ST_LATFROMGEOHASH(hash_value) FROM geohashes;
......@@ -576,20 +560,20 @@ POINT(180 50)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("5zpgxczbzurypzpgxczb", 0))
POINT(0 -50)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z0z", 0)) c;
c
POINT(-145.16129032258067 -49.35483870967742)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
c
POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
c
POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " "));
ST_ASTEXT(ST_POINTFROMGEOHASH("1e1", " "))
......@@ -609,14 +593,14 @@ POINT(-133.548387096774 -84.1935483870967)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("99999999999999999999", 0))
POINT(-110.3225806451612 8.7096774193548)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** "));
ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** "))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " ***** ")) c;
c
POINT(-180 -90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 "));
ST_ASTEXT(ST_POINTFROMGEOHASH("00000000000000000000", " 0 "))
POINT(-180 -90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR))));
ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR))))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))) c;
c
POINT(180 90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0));
ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0))
......@@ -633,8 +617,8 @@ NULL
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0));
ST_ASTEXT(ST_POINTFROMGEOHASH(CAST("012" AS BINARY), 0))
POINT(-179 -82)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY))));
ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY))))
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))) c;
c
POINT(180 90)
# invalid characters and inputs
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123a45", 0));
......@@ -690,31 +674,23 @@ ERROR 21000: Operand should contain 1 column(s)
# very long geohash
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0))
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC"
"DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR"
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC"
"DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR"
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0))
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn"
"mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98"
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn"
"mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98"
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0))
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
c
POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN"
"MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98"
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0));
ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN"
"MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98"
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0))
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
c
POINT(179.55743439816956 82.77450549262497)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
......@@ -726,11 +702,8 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789
"bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmnp"
"qrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01"
"23456789bcdefghjkmnpqrstuvwxyz0123456789bcde"
"fghjkmnpqrstuvwxyz", 4326));
ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123"
"fghjkmnpqrstuvwxyz", 4326)) c;
c
POINT(-179.55743439816956 -82.77450549262497)
# different random geohash values
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(hash_value,0)) FROM geohashes;
......@@ -883,29 +856,29 @@ cb0bh2n0p0581b0bh2n0p8
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75);
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -45)'),75)
3b0bh2n0p0581b0bh2n0p8
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 0.0001)'))),80);
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;
c
s0000000d6dsd0dzz1ms0zz7z1wzhy00000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(0.0001 -0.0001)'))),85);
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;
c
kpbpbpbp6m6e6p6bpntebbpkpnqbuf0000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 0.0001)'))),90);
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;
c
ebpbpbpbtdtktbtpbc6kppbebc9p5q000000000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'))),100);
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;
c
7zzzzzzzmtm7mzm00yd7z00s0y30g60000000000000000000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20);
ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20)
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066400000000000805640),20) c;
c
zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20);
ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20)
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x010100000000000000008066C00000000000805640),20) c;
c
bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20);
ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20)
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x00000000014066800000000000C056800000000000),20) c;
c
pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20);
ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20)
SELECT ST_GEOHASH(ST_GEOMFROMWKB(0x0000000001C066800000000000C056800000000000),20) c;
c
00000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1");
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(0 0)'),"1")
......@@ -922,20 +895,20 @@ NULL
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL);
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-0.0001 -0.0001)'),NULL)
7zzzzzzzmtm7mzm00yd7z00s0y30g60000000000000000000000000000000000000000000000000000000000000000000000
SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(180 90)'),ST_GEOMFROMTEXT('POINT(0 0)')),20);
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;
c
zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_DIFFERENCE(ST_GEOMFROMTEXT('POINT(-180 90)'),ST_GEOMFROMTEXT('MULTIPOINT(0 0,100 100)')),20);
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;
c
bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(180 -90)'),ST_GEOMFROMTEXT('POINT(180 -90)')),20);
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;
c
pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_INTERSECTION(ST_GEOMFROMTEXT('POINT(-180 -90)'),ST_GEOMFROMTEXT('POINT(-180 -90)')),20);
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;
c
00000000000000000000
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY)));
ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY)))
SELECT ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 90)'),(CAST(10 AS BINARY))) c;
c
zzzzzzzzzz
SELECT 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))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20));
ST_LONGFROMGEOHASH(ST_GEOHASH(18*10,900/10,20))
180
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 10)'),10)) c;
c
100
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c;
c
10
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10)) c;
c
-10
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 10)'),10)) c;
c
1
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 10)'),10)) c;
c
-1
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 90)'),20)) c;
c
1.00101
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 90)'),20)) c;
c
-1.00101
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10));
ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10))
SELECT ST_LONGFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10)) c;
c
20
#=============================================================
# ST_LATFROMGEOHASH()
......@@ -1225,29 +1198,29 @@ ST_LATFROMGEOHASH(ST_GEOHASH(0,89.999999,20))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20));
ST_LATFROMGEOHASH(ST_GEOHASH(18*10,900/10,20))
90
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 50)'),10)) c;
c
50
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10)) c;
c
10
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -10)'),10)) c;
c
-10
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 1.000)'),10)) c;
c
1
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 -1.0000)'),10)) c;
c
-1
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(180 1.00101)'),20)) c;
c
1.00101
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-100 -1.00101)'),20)) c;
c
-1.00101
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10));
ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10))
SELECT ST_LATFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 -20)'),10)) c;
c
-20
#=============================================================
# ST_POINTFROMGEOHASH()
......@@ -1306,29 +1279,29 @@ POINT(0 -89.999999)
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))
POINT(180 90)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(100 50)'),10),0));
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;
c
POINT(100 50)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(10 10)'),10),0));
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;
c
POINT(10 10)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-10 10)'),10),0));
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;
c
POINT(-10 10)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.000 1.00010)'),10),0));
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;
c
POINT(1 1.0001)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.000 -1.1010)'),10),0));
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;
c
POINT(-1 -1.101)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(1.00101 1.000)'),10),0));
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;
c
POINT(1.00101 1)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(-1.00101 -1.0000)'),20),0));
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;
c
POINT(-1.00101 -1)
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(ST_GEOHASH(ST_GEOMFROMTEXT('POINT(20 20)'),10),0));
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;
c
POINT(20 20)
#=============================================================
# ST_GEOHASH()
......@@ -1372,96 +1345,80 @@ pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20);
ST_GEOHASH(ST_POINTFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp",0),20)
bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
c
zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("00000000000000000000"),20) c;
c
00000000000000000000
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("00000000000000000000"),20) c;
c
pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("00000000000000000000"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
c
bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
c
zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c;
c
pbpbpbpbpbpbpbpbpbpb
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),ST_LATFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),20) c;
c
zzzzzzzzzzzzzzzzzzzz
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz"),20) c;
c
bpbpbpbpbpbpbpbpbpbp
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20);
ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20)
SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb"),20) c;
c
00000000000000000000
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci);
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
c
-179.55743439816956
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci);
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
c
-179.55743439816956
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci);
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
c
-179.55743439816956
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci);
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
c
-179.55743439816956
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci);
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
c
-82.77450549262497
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci);
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
c
-82.77450549262497
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci);
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
c
-82.77450549262497
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci);
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci)
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
c
-82.77450549262497
SELECT
ST_ASTEXT(
......@@ -1470,14 +1427,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci,
4326
)
);
ST_ASTEXT(
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci,
4326
)
)
) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT
ST_ASTEXT(
......@@ -1486,14 +1437,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci,
4326
)
);
ST_ASTEXT(
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci,
4326
)
)
) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT
ST_ASTEXT(
......@@ -1502,14 +1447,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci,
4326
)
);
ST_ASTEXT(
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci,
4326
)
)
) c;
c
POINT(-179.55743439816956 -82.77450549262497)
SELECT
ST_ASTEXT(
......@@ -1518,14 +1457,8 @@ CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci,
4326
)
);
ST_ASTEXT(
ST_POINTFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci,
4326
)
)
) c;
c
POINT(-179.55743439816956 -82.77450549262497)
CREATE TABLE t1 (val DOUBLE);
INSERT INTO t1 (val) VALUES (12.2);
......@@ -1670,8 +1603,8 @@ ST_LatFromGeoHash('xkcd')
SELECT ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4);
ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4)
s020
SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d');
ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d')
SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d') c;
c
-25.098643334722453
#
# Bug#22838668 CRASH IN ITEM_FUNC_LATLONGFROMGEOHASH::VAL_REAL
......
......@@ -187,19 +187,19 @@ SELECT ST_LONGFROMGEOHASH(abcdef);
--echo # very long geohash
SELECT ST_LONGFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkm"
"npqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01234567"
"89bcdefghjkmnpqrstuvwxyz");
"89bcdefghjkmnpqrstuvwxyz") c;
SELECT ST_LONGFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKM"
"NPQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ01234567"
"89BCDEFGHJKMNPQRSTUVWXYZ");
"89BCDEFGHJKMNPQRSTUVWXYZ") c;
SELECT ST_LONGFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfed"
"cb9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvuts"
"rqpnmkjhgfedcb9876543210");
"rqpnmkjhgfedcb9876543210") c;
SELECT ST_LONGFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFED"
"CB9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTS"
"RQPNMKJHGFEDCB9876543210");
"RQPNMKJHGFEDCB9876543210") c;
# Table with different extreme values
CREATE TABLE geohashes (gid INT NOT NULL PRIMARY KEY, hash_value VARCHAR(255));
......@@ -394,19 +394,19 @@ SELECT ST_LATFROMGEOHASH(abcdef);
--echo # very long geohash
SELECT ST_LATFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmn"
"pqrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz0123456789"
"bcdefghjkmnpqrstuvwxyz");
"bcdefghjkmnpqrstuvwxyz") c;
SELECT ST_LATFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMN"
"PQRSTUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789"
"BCDEFGHJKMNPQRSTUVWXYZ");
"BCDEFGHJKMNPQRSTUVWXYZ") c;
SELECT ST_LATFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedc"
"b9876543210zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrq"
"pnmkjhgfedcb9876543210");
"pnmkjhgfedcb9876543210") c;
SELECT ST_LATFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDC"
"B9876543210ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQ"
"PNMKJHGFEDCB9876543210");
"PNMKJHGFEDCB9876543210") c;
--echo # different random geohash values
SELECT ST_LATFROMGEOHASH(hash_value) FROM geohashes;
......@@ -479,15 +479,15 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zbzurypzpgxczbzurypz", 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", " "));
......@@ -501,11 +501,11 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("11111111111111111111", 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("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR))));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS CHAR)))) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(NULL, 0));
......@@ -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("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY))));
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zzzzzzzzzzzzzzzzzzzz", (CAST(0 AS BINARY)))) c;
# Invalid characters and inputs
......@@ -601,19 +601,19 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH((1, 1), 1));
--echo # very long geohash
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0));
"stuvwxyz0123456789bcdefghjkmnpqrstuvwxyz", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789BCDEFGHJKMNPQRSTUVWXYZ0123456789BC"
"DEFGHJKMNPQRSTUVWXYZ0123456789BCDEFGHJKMNPQR"
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0));
"STUVWXYZ0123456789BCDEFGHJKMNPQRSTUVWXYZ", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("zyxwvutsrqpnmkjhgfedcb9876543210zyxwvutsrqpn"
"mkjhgfedcb9876543210zyxwvutsrqpnmkjhgfedcb98"
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0));
"76543210zyxwvutsrqpnmkjhgfedcb9876543210", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("ZYXWVUTSRQPNMKJHGFEDCB9876543210ZYXWVUTSRQPN"
"MKJHGFEDCB9876543210ZYXWVUTSRQPNMKJHGFEDCB98"
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0));
"76543210ZYXWVUTSRQPNMKJHGFEDCB9876543210", 0)) c;
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789bc"
"defghjkmnpqrstuvwxyz0123456789bcdefghjkmnpqr"
......@@ -625,7 +625,7 @@ SELECT ST_ASTEXT(ST_POINTFROMGEOHASH("0123456789bcdefghjkmnpqrstuvwxyz0123456789
"bcdefghjkmnpqrstuvwxyz0123456789bcdefghjkmnp"
"qrstuvwxyz0123456789bcdefghjkmnpqrstuvwxyz01"
"23456789bcdefghjkmnpqrstuvwxyz0123456789bcde"
"fghjkmnpqrstuvwxyz", 4326));
"fghjkmnpqrstuvwxyz", 4326)) c;
--echo # different random geohash values
SELECT ST_ASTEXT(ST_POINTFROMGEOHASH(hash_value,0)) FROM geohashes;
......@@ -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_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");
......@@ -749,15 +749,15 @@ SELECT ST_GEOHASH(NULL,100);
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);
......@@ -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(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 # ST_LATFROMGEOHASH()
......@@ -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(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 # ST_POINTFROMGEOHASH()
......@@ -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(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 # ST_GEOHASH()
......@@ -1199,23 +1199,23 @@ SELECT ST_GEOHASH(ST_POINTFROMGEOHASH("pbpbpbpbpbpbpbpbpbpb",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
......@@ -1223,42 +1223,42 @@ SELECT ST_GEOHASH(ST_LONGFROMGEOHASH("bpbpbpbpbpbpbpbpbpbp"),ST_LATFROMGEOHASH("
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
SELECT
ST_LONGFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci) c;
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci) c;
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) c;
SELECT
ST_LATFROMGEOHASH(
CAST("0123456789bcdefghjkmnpqrstuvwxyz0123456789BCDEFGHJKMNPQRSTUVWXYZ"
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci);
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci) c;
SELECT
ST_ASTEXT(
......@@ -1267,7 +1267,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_persian_ci,
4326
)
);
) c;
SELECT
ST_ASTEXT(
......@@ -1276,7 +1276,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_czech_ci,
4326
)
);
) c;
SELECT
ST_ASTEXT(
......@@ -1285,7 +1285,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci,
4326
)
);
) c;
SELECT
ST_ASTEXT(
......@@ -1294,7 +1294,7 @@ SELECT
AS CHAR CHARACTER SET utf8) COLLATE utf8_hungarian_ci,
4326
)
);
) c;
#####################################################################
# Bug#19383904
......@@ -1405,7 +1405,7 @@ SELECT ST_GeoHash(ST_PointFromGeoHash('xkcd', 0), 4);
SELECT ST_LongFromGeoHash('xkcd');
SELECT ST_LatFromGeoHash('xkcd');
SELECT ST_GeoHash(ST_PointFromGeoHash('ebrb', 0), 4);
SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d');
SELECT ST_LatFromGeoHash('m7s9pyctu9bbwqkgbw5x6vutzkztd9szjh86gmz9w9nsz6792d') c;
--echo #
--echo # Bug#22838668 CRASH IN ITEM_FUNC_LATLONGFROMGEOHASH::VAL_REAL
......@@ -1452,4 +1452,4 @@ INSERT INTO t1 VALUES ('bbbb');
SELECT ST_LatFromGeohash(col1) FROM t1;
SELECT ST_LongFromGeohash(col1) FROM t1;
SELECT ST_AsText(ST_PointFromGeohash(col1, 4326)) FROM t1;
DROP TABLE t1;
\ No newline at end of file
DROP TABLE t1;
......@@ -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)'));
ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(0 0,0 5,5 5,5 0,0 0)'))
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOINT(1 -1,1e308 -1e308,0.0001 0.000)'));
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;
c
1
#====================================================================================
# linestring
......@@ -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)'));
ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(0 0,0 5,5 5,5 0,0 0)'))
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('LINESTRING(1 -1,1e308 -1e308,0.0001 0.000)'));
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;
c
1
#====================================================================================
# multilinestring
......@@ -123,20 +123,20 @@ ST_ISVALID(g)
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'));
ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,1 1,2 2),(3 3))'));
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;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,-0.00 0),(0.0 0))'));
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;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,0 5,5 5,5 0,0 0))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((0 10,10 0),(10 0,0 0),(0 0,10 10))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTILINESTRING((1 -1,1e308 -1e308,0.0001 0.000),(2 2,4 -9.002))'));
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;
c
1
#====================================================================================
# polygon
......@@ -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))'));
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 5,5 5,0 0))'))
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((0 0,0 10,10 10,10 0,0 0,0 0))'));
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;
c
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))'));
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;
c
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))'));
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;
c
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))'));
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;
c
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))'));
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;
c
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))'));
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;
c
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))'));
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;
c
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))'));
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;
c
1
#====================================================================================
# multipolygon
......@@ -192,41 +192,41 @@ ST_ISVALID(g)
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)))'))
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))'));
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;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 10,10 0,0 0,0 10)),((0 0,10 10,10 0,0 0)))'));
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;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('MULTIPOLYGON(((10 10,10 0,5 10,10 10)),((0 10,0 20,5 10,0 10)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
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)))'));
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;
c
0
#====================================================================================
# geometrycollection
......@@ -243,53 +243,48 @@ ST_ISVALID(g)
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'));
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'))
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'));
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')) c;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION()))'));
ERROR 22023: Invalid GIS data provided to function st_isvalid.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))'));
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;
c
1
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.
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))'));
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))'))
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),POINT(10 10))')) c;
c
0
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCOLLECTION())'));
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())'));
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)))'));
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;
c
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)))'));
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;
c
0
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)))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('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)))'));
ST_ISVALID(ST_GEOMFROMTEXT('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)))')) c;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION('
'GEOMETRYCOLLECTION(POLYGON((0 0,0 10,10 10,10 0,0 0,0 0)))))'));
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)),'
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))'));
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;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10)),'
......@@ -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)),'
'MULTIPOINT(0 0,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))))'));
ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0),'
'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)),
'MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0,0 0)),((10 10,10 15,15 15,15 10,10 10))))')) c;
c
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)),'
'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))'));
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
'MULTIPOINT(-7 -5,6 9,7 4))')) c;
c
1
#####################################################################################
# Invalid function calls
......@@ -386,8 +378,8 @@ ST_ISVALID(ST_GEOMFROMTEXT(@star_of_elems,4294967297))
SELECT ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000));
ST_ISVALID(ST_GEOMFROMTEXT(@star_collection_elems,4294967295000))
0
SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000');
ST_ISVALID( x'e6100000010100000000000000000000000000000000000000')
SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000') c;
c
1
# Clean up
DROP TABLE gis_geometrycollection;
......@@ -398,14 +390,10 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168
-167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054
187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,49.8714768817168
-176.0048853643874,72.8714768817168 -167.0048853643874))'));
ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168
-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
-176.0048853643874,72.8714768817168 -167.0048853643874))')) c;
c
1
SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((-200 0,-207.99999999999997
135.36742435621204,-208 1,-208 0,-208 -276.9111154485375,-200 0))'));
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;
c
1
......@@ -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(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 # linestring
......@@ -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(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 # multilinestring
......@@ -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,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 # polygon
......@@ -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 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 # multipolygon
......@@ -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(((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 # geometrycollection
......@@ -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(LINESTRING(0 0))'));
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')) c;
--error ER_GIS_INVALID_DATA
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
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
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCOLLECTION())'));
......@@ -235,26 +235,26 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0),GEOMETRYCO
--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(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),'
'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),'
'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)))'));
'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
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION('
'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)),'
'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
SELECT ST_ISVALID(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(10 10),'
'MULTIPOINT(0 0,10 10)),'
......@@ -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)),'
'MULTIPOINT(0 0,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)),'
'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 # Invalid function calls
......@@ -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
# littleendian, and is a point with coordinates (0,0)
SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000');
SELECT ST_ISVALID( x'e6100000010100000000000000000000000000000000000000') c;
--echo # Clean up
DROP TABLE gis_geometrycollection;
......@@ -375,7 +375,7 @@ SELECT ST_ISVALID(ST_GEOMFROMTEXT('POLYGON((72.8714768817168
-167.0048853643874,9274.40641550926 3433.5957427942167,-58.09039811390054
187.50989457746405,-81.09039811390053 179.50989457746405,-207.99999999999997
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
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)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-5 -2)'), 2000000))
POINT(-5 -2)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-10 6)'), 1234567890)) c;
c
POINT(-10 6)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(-16 -8)'), 111111111111)) c;
c
POINT(-16 -8)
#####################################################################################
# ST_SIMPLIFY(multipoint)
#####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(19 -4, -2 -6, -8 2)'), 1));
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;
c
MULTIPOINT(19 -4,-2 -6,-8 2)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-3 14, 19 8, 10 -8)'), 2));
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;
c
MULTIPOINT(-3 14,19 8,10 -8)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(1 -8, -1 12, -11 16)'), 3));
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;
c
MULTIPOINT(1 -8,-1 12,-11 16)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT(-16 11, -2 -7, -11 11)'), 4));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
MULTIPOINT(3 -13,18 -2,-5 -13,-12 1,20 0,-6 14,5 -4)
#####################################################################################
# ST_SIMPLIFY(linestring)
#####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 5,10 10)'), 1));
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;
c
LINESTRING(0 0,10 10)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.5));
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;
c
LINESTRING(0 0,5 0,5 5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,5 0,5 5)'), 3.6));
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;
c
LINESTRING(0 0,5 5)
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,4 4,6 -6,10 0)'), 5));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
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)
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));
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;
c
LINESTRING(0 0,1 1,6 0,5 -1,0 0)
#####################################################################################
# ST_SIMPLIFY(multilinestring)
#####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING((0 0,5 5,10 10))'), 1));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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),'
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.6));
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;
c
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),'
'(0 0,1 0,1 1,2 1,2 2,3 2,3 3,4 3,4 4,5 4,4 4))'), 0.7));
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;
c
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));
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;
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))
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));
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;
c
MULTILINESTRING((0 0,1 1,6 0),(6 0,5 -1,0 0))
#####################################################################################
# ST_SIMPLIFY(polygon)
#####################################################################################
# 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));
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;
c
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));
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;
c
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));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,10 10,-10 10,0 0))'), 14));
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;
c
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));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,5 5,0 10,-5 5,0 0))'), 4.9));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
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))
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));
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;
c
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));
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;
c
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));
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;
c
NULL
#####################################################################################
# ST_SIMPLIFY(multipolygon)
#####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)))'), 3.5));
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;
c
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));
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;
c
NULL
# 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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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)),'
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 3));
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;
c
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)),'
'((0 0,-4 -6,0 -10,4 -6,0 0)),((0 0,6 -4,10 0,6 4,0 0)))'), 4));
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;
c
NULL
#####################################################################################
# ST_SIMPLIFY(geometrycollection)
#####################################################################################
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(POINT(0 0))'), 1)) c;
c
GEOMETRYCOLLECTION(POINT(0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(MULTIPOINT(0 0,1 0,1 1,2 0,2 2))'), 1));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
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));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()'), 1)) c;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION())'), 1)) c;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.5));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(), LINESTRING(0 0,5 0,5 5))'), 3.6));
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;
c
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));
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;
c
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));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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)))'), 3.5));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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)))'), 3.5)) c;
c
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('
'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)))'), 3.6));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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)))'), 3.6)) c;
c
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,5 5,0 0))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 4.9));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'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;
c
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('
'LINESTRING(0 0,5 5,0 10,-5 5,0 0),'
'POLYGON((0 0,-5 -5,0 -10,5 -5,0 0)))'), 5));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'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;
c
GEOMETRYCOLLECTION(LINESTRING(0 0,0 10,0 0))
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)),'
'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 4.9));
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)),'
'MULTIPOLYGON(((0 0,5
'MULTIPOLYGON(((0 0,5 -5,10 0,5 5,0 0)),((0 0,-5 5,-10 0,-5 -5,0 0))))'), 4.9)) c;
c
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('
'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));
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)),'
'MULTIPOLYGON(((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;
c
GEOMETRYCOLLECTION(MULTILINESTRING((0 0,0 10,0 0),(0 0,0 -10,0 0)))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 1)) c;
c
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('
'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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 2));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 2)) c;
c
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('
'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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 3));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 3)) c;
c
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('
'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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 4));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 4)) c;
c
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('
'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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 7));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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 -2,5 -2,0 -3,5 -3,0 -4,5 -4,0 0))'), 7)) c;
c
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.
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)),'
'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))))'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
'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;
c
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.
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)),'
'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))))'), 2));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
'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;
c
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.
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)),'
'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))))'), 3));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
'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;
c
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.
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)),'
'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))))'), 4));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'POINT(0 0),'
'LINESTRING(0 0,2.5 2.5,0 5,-2.5 7.5,0 10),'
'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;
c
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
......@@ -560,8 +515,8 @@ NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOINT()'), 1))
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)) c;
c
NULL
SELECT 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
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POINT(12,34 0)'), 1))
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(a 0,10 10)'), 1));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1));
ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1))
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(0 0,! 10)'), 1)) c;
c
NULL
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
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('LINESTRING(12,34 0,10 10)'), 1));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((a 0,10 10,10 0,0 0))'), 1));
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;
c
NULL
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((0 0,! 10,10 0,0 0))'), 1));
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;
c
NULL
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
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('POLYGON((12,34 0,10 10,10 0,0 0))'), 1));
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;
c
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));
ERROR HY000: Incorrect arguments to st_simplify
......
......@@ -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(-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 # ST_SIMPLIFY(multipoint)
--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 # ST_SIMPLIFY(linestring)
--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
# 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
# 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
# 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 # ST_SIMPLIFY(multilinestring)
--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
# 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),'
'(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),'
'(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
# 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 # ST_SIMPLIFY(polygon)
--echo #####################################################################################
--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 # ST_SIMPLIFY(multipolygon)
--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.
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)),'
'((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)),'
'((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 # ST_SIMPLIFY(geometrycollection)
--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('
'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)))'), 3.5));
'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.5)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('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)))'), 3.6));
'POLYGON((0 0,0 -5,-5 -5,-5 0,0 0)))'), 3.6)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION('
'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('
'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('
'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('
'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('
'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 -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('
'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 -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('
'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 -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('
'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 -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('
'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 -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.
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)),'
'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))))'), 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.
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)),'
'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))))'), 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.
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)),'
'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))))'), 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.
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)),'
'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))))'), 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 # ST_ASTEXT(ST_SIMPLIFY(geometry) with different SRID values
......@@ -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('MULTILINESTRING(())'), 1));
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTILINESTRING(())'), 1)) c;
SELECT ST_ASTEXT(ST_SIMPLIFY(ST_GEOMFROMTEXT('MULTIPOLYGON((()))'), 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('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
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
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
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.
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT(15 25)')))
POINT(15 25)
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOINT(5 0,25 0,15 10,15 25)')));
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;
c
MULTIPOINT(5 0,25 0,15 10,15 25)
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)')))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(10 15,20 15)'))) c;
c
LINESTRING(10 15,20 15)
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((25 0,0 15,15 30,0 5))')));
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;
c
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))')));
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;
c
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)))')));
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;
c
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),'
'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)))')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('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)))'))) c;
c
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
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT()')));
......@@ -57,37 +54,37 @@ NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON(())')))
NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))')))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON((()),(()))'))) c;
c
NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION()')))
GEOMETRYCOLLECTION EMPTY
# Invalid geometries return null
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('LINESTRING(0 0,-0.00 0,0.0 0)')));
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;
c
NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))')))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTILINESTRING((0 0))'))) c;
c
NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POLYGON((0 0))')))
NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('MULTIPOLYGON(((1 1, 1 1, 1 1, 1 1, 1 1)))')));
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;
c
NULL
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')));
ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))')))
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(0 0))'))) c;
c
NULL
# 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))')));
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;
c
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)))')));
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;
c
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)))')));
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;
c
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
SELECT ST_VALIDATE(ST_GEOMFROMTEXT('POINT(0 270)', 4326));
......
......@@ -33,15 +33,15 @@ SELECT ST_VALIDATE( x'00000000DEADBEEF');
--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('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('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('MULTIPOLYGON(((0 0,0 10,10 10,0 0)),((10 10,10 15,15 15,10 10)))')));
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)'))) c;
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))'))) 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)))'))) c;
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('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)))')));
'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
SELECT ST_ASTEXT(ST_VALIDATE(ST_GEOMFROMTEXT('POINT()')));
......@@ -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('MULTILINESTRING(())')));
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()')));
--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('MULTILINESTRING((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))'))) c;
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('GEOMETRYCOLLECTION(LINESTRING(0 0))')));
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))'))) c;
--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('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('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('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)))'))) 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)))'))) c;
--echo # ST_VALIDATE raises an error if longitude is out of range
--error ER_LONGITUDE_OUT_OF_RANGE
......
......@@ -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());
double latitude, longitude;
......
......@@ -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,
uint length);
......@@ -1291,22 +1291,28 @@ class Item_func_geohash: public Item_geometry_func
public:
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 *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
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_geohash") };
return name;
}
String *val_str(String *) override;
String *val_str_ascii(String *) override;
Item *do_get_copy(THD *thd) const override
{ 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:
String buf;
static const uint8_t geohash_alphabet[256];
......
......@@ -105,6 +105,8 @@ class Item_str_ascii_checksum_func: public Item_str_ascii_func
:Item_str_ascii_func(thd, a) { }
Item_str_ascii_checksum_func(THD *thd, Item *a, Item *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
{
// Always use binary argument comparison: MD5('x') != MD5('X')
......
......@@ -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;
bool has_cached_result;
......@@ -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_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
{
return GEOMETRY_COLLECT_FUNC;
}
void no_rows_in_result() override {; }
void make_const(longlong count_arg)
{
Item_sum_int::make_const();
}
const Type_handler *type_handler() const override
{ return &type_handler_string; }
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