SELECT fid, AsText(Envelope(g)) FROM gis_geometry;
fid AsText(Envelope(g))
fid AsText(Envelope(g))
101 POLYGON((10 10,10 10,10 10,10 10,10 10))
101 POLYGON((10 10,10 10,10 10,10 10,10 10))
102 POLYGON((20 10,20 10,20 10,20 10,20 10))
102 POLYGON((20 10,20 10,20 10,20 10,20 10))
...
@@ -224,161 +224,165 @@ fid AsText(Envelope(g))
...
@@ -224,161 +224,165 @@ fid AsText(Envelope(g))
119 POLYGON((0 0,3 0,3 3,0 3,0 0))
119 POLYGON((0 0,3 0,3 3,0 3,0 0))
120 POLYGON((0 0,10 0,10 10,0 10,0 0))
120 POLYGON((0 0,10 0,10 10,0 10,0 0))
121 POLYGON((3 6,44 6,44 9,3 9,3 6))
121 POLYGON((3 6,44 6,44 9,3 9,3 6))
explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from geo;
explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE geo ALL NULL NULL NULL NULL 21
1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
Warnings:
Warnings:
Note 1003 select high_priority dimension(test.geo.g) AS `Dimension(g)`,geometrytype(test.geo.g) AS `GeometryType(g)`,isempty(test.geo.g) AS `IsEmpty(g)`,astext(envelope(test.geo.g)) AS `AsText(Envelope(g))` from test.geo
Note 1003 select high_priority dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry
SELECT fid, X(g) FROM pt;
SELECT fid, X(g) FROM gis_point;
fid X(g)
fid X(g)
101 10
101 10
102 20
102 20
103 20
103 20
104 10
104 10
SELECT fid, Y(g) FROM pt;
SELECT fid, Y(g) FROM gis_point;
fid Y(g)
fid Y(g)
101 10
101 10
102 10
102 10
103 20
103 20
104 20
104 20
explain extended select X(g),Y(g) FROM pt;
explain extended select X(g),Y(g) FROM gis_point;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE pt ALL NULL NULL NULL NULL 4
1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
Warnings:
Warnings:
Note 1003 select high_priority x(test.pt.g) AS `X(g)`,y(test.pt.g) AS `Y(g)` from test.pt
Note 1003 select high_priority x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point
SELECT fid, AsText(StartPoint(g)) FROM ls;
SELECT fid, AsText(StartPoint(g)) FROM gis_line;
fid AsText(StartPoint(g))
fid AsText(StartPoint(g))
105 POINT(0 0)
105 POINT(0 0)
106 POINT(10 10)
106 POINT(10 10)
107 POINT(10 10)
107 POINT(10 10)
SELECT fid, AsText(EndPoint(g)) FROM ls;
SELECT fid, AsText(EndPoint(g)) FROM gis_line;
fid AsText(EndPoint(g))
fid AsText(EndPoint(g))
105 POINT(10 0)
105 POINT(10 0)
106 POINT(10 10)
106 POINT(10 10)
107 POINT(40 10)
107 POINT(40 10)
SELECT fid, GLength(g) FROM ls;
SELECT fid, GLength(g) FROM gis_line;
fid GLength(g)
fid GLength(g)
105 24.142135623731
105 24.142135623731
106 40
106 40
107 30
107 30
SELECT fid, NumPoints(g) FROM ls;
SELECT fid, NumPoints(g) FROM gis_line;
fid NumPoints(g)
fid NumPoints(g)
105 3
105 3
106 5
106 5
107 2
107 2
SELECT fid, AsText(PointN(g, 2)) FROM ls;
SELECT fid, AsText(PointN(g, 2)) FROM gis_line;
fid AsText(PointN(g, 2))
fid AsText(PointN(g, 2))
105 POINT(0 10)
105 POINT(0 10)
106 POINT(20 10)
106 POINT(20 10)
107 POINT(40 10)
107 POINT(40 10)
SELECT fid, IsClosed(g) FROM ls;
SELECT fid, IsClosed(g) FROM gis_line;
fid IsClosed(g)
fid IsClosed(g)
105 0
105 0
106 1
106 1
107 0
107 0
explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM ls;
explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE ls ALL NULL NULL NULL NULL 3
1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
Warnings:
Warnings:
Note 1003 select high_priority astext(startpoint(test.ls.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.ls.g)) AS `AsText(EndPoint(g))`,glength(test.ls.g) AS `GLength(g)`,numpoints(test.ls.g) AS `NumPoints(g)`,astext(pointn(test.ls.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.ls.g) AS `IsClosed(g)` from test.ls
Note 1003 select high_priority astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line
SELECT fid, AsText(Centroid(g)) FROM p;
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
fid AsText(Centroid(g))
fid AsText(Centroid(g))
108 POINT(15 15)
108 POINT(15 15)
109 POINT(25.416666666667 25.416666666667)
109 POINT(25.416666666667 25.416666666667)
110 POINT(20 10)
110 POINT(20 10)
SELECT fid, Area(g) FROM p;
SELECT fid, Area(g) FROM gis_polygon;
fid Area(g)
fid Area(g)
108 100
108 100
109 2400
109 2400
110 450
110 450
SELECT fid, AsText(ExteriorRing(g)) FROM p;
SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon;
fid AsText(ExteriorRing(g))
fid AsText(ExteriorRing(g))
108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
110 LINESTRING(0 0,30 0,30 30,0 0)
110 LINESTRING(0 0,30 0,30 30,0 0)
SELECT fid, NumInteriorRings(g) FROM p;
SELECT fid, NumInteriorRings(g) FROM gis_polygon;
fid NumInteriorRings(g)
fid NumInteriorRings(g)
108 0
108 0
109 1
109 1
110 0
110 0
SELECT fid, AsText(InteriorRingN(g, 1)) FROM p;
SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon;
fid AsText(InteriorRingN(g, 1))
fid AsText(InteriorRingN(g, 1))
108 NULL
108 NULL
109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
110 NULL
110 NULL
explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM p;
explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE p ALL NULL NULL NULL NULL 3
1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
Warnings:
Warnings:
Note 1003 select high_priority astext(centroid(test.p.g)) AS `AsText(Centroid(g))`,area(test.p.g) AS `Area(g)`,astext(exteriorring(test.p.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.p.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.p.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.p
Note 1003 select high_priority astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon
SELECT fid, IsClosed(g) FROM mls;
SELECT fid, IsClosed(g) FROM gis_multi_line;
fid IsClosed(g)
fid IsClosed(g)
114 0
114 0
115 0
115 0
116 0
116 0
SELECT fid, AsText(Centroid(g)) FROM mp;
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
fid AsText(Centroid(g))
fid AsText(Centroid(g))
117 POINT(55.588527753042 17.426536064114)
117 POINT(55.588527753042 17.426536064114)
118 POINT(55.588527753042 17.426536064114)
118 POINT(55.588527753042 17.426536064114)
119 POINT(2 2)
119 POINT(2 2)
SELECT fid, Area(g) FROM mp;
SELECT fid, Area(g) FROM gis_multi_polygon;
fid Area(g)
fid Area(g)
117 1684.5
117 1684.5
118 1684.5
118 1684.5
119 4.5
119 4.5
SELECT fid, NumGeometries(g) from mpt;
SELECT fid, NumGeometries(g) from gis_multi_point;
fid NumGeometries(g)
fid NumGeometries(g)
111 4
111 4
112 4
112 4
113 2
113 2
SELECT fid, NumGeometries(g) from mls;
SELECT fid, NumGeometries(g) from gis_multi_line;
fid NumGeometries(g)
fid NumGeometries(g)
114 2
114 2
115 1
115 1
116 2
116 2
SELECT fid, NumGeometries(g) from mp;
SELECT fid, NumGeometries(g) from gis_multi_polygon;
fid NumGeometries(g)
fid NumGeometries(g)
117 2
117 2
118 2
118 2
119 1
119 1
SELECT fid, NumGeometries(g) from gc;
SELECT fid, NumGeometries(g) from gis_geometrycollection;
fid NumGeometries(g)
fid NumGeometries(g)
120 2
120 2
121 2
121 2
explain extended SELECT fid, NumGeometries(g) from mpt;
explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE mpt ALL NULL NULL NULL NULL 3
1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
Warnings:
Warnings:
Note 1003 select high_priority test.mpt.fid AS `fid`,numgeometries(test.mpt.g) AS `NumGeometries(g)` from test.mpt
Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point
SELECT fid, AsText(GeometryN(g, 2)) from mpt;
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
fid AsText(GeometryN(g, 2))
fid AsText(GeometryN(g, 2))
111 POINT(10 10)
111 POINT(10 10)
112 POINT(11 11)
112 POINT(11 11)
113 POINT(4 10)
113 POINT(4 10)
SELECT fid, AsText(GeometryN(g, 2)) from mls;
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line;
fid AsText(GeometryN(g, 2))
fid AsText(GeometryN(g, 2))
114 LINESTRING(16 0,16 23,16 48)
114 LINESTRING(16 0,16 23,16 48)
115 NULL
115 NULL
116 LINESTRING(2 5,5 8,21 7)
116 LINESTRING(2 5,5 8,21 7)
SELECT fid, AsText(GeometryN(g, 2)) from mp;
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon;
fid AsText(GeometryN(g, 2))
fid AsText(GeometryN(g, 2))
117 POLYGON((59 18,67 18,67 13,59 13,59 18))
117 POLYGON((59 18,67 18,67 13,59 13,59 18))
118 POLYGON((59 18,67 18,67 13,59 13,59 18))
118 POLYGON((59 18,67 18,67 13,59 13,59 18))
119 NULL
119 NULL
SELECT fid, AsText(GeometryN(g, 2)) from gc;
SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection;
fid AsText(GeometryN(g, 2))
fid AsText(GeometryN(g, 2))
120 LINESTRING(0 0,10 10)
120 LINESTRING(0 0,10 10)
121 LINESTRING(3 6,7 9)
121 LINESTRING(3 6,7 9)
explain extended SELECT fid, AsText(GeometryN(g, 2)) from mpt;
SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection;
fid AsText(GeometryN(g, 1))
120 POINT(0 0)
121 POINT(44 6)
explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE mpt ALL NULL NULL NULL NULL 3
1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
Warnings:
Warnings:
Note 1003 select high_priority test.mpt.fid AS `fid`,astext(geometryn(test.mpt.g,2)) AS `AsText(GeometryN(g, 2))` from test.mpt
Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point
SELECT g1.fid as first, g2.fid as second,
SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gc g1, gc g2 ORDER BY first, second;
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0
120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0
120 121 0 0 0 0 0 0 1 0
...
@@ -388,46 +392,46 @@ explain extended SELECT g1.fid as first, g2.fid as second,
...
@@ -388,46 +392,46 @@ explain extended SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gc g1, gc g2 ORDER BY first, second;
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE g2 ALL NULL NULL NULL NULL 2
1 SIMPLE g2 ALL NULL NULL NULL NULL 2
Warnings:
Warnings:
Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gc g1 join test.gc g2 order by test.g1.fid,test.g2.fid
Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid
DROP TABLE pt, ls, p, mpt, mls, mp, gc, geo;
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;