mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
PostGIS-style 'same point' handling.
This commit is contained in:
@ -392,10 +392,10 @@ 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
|
||||
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
|
||||
first second w c o e d t i r
|
||||
120 120 0 0 0 1 0 1 1 0
|
||||
120 120 1 1 0 1 0 1 1 1
|
||||
120 121 0 0 1 0 0 0 1 0
|
||||
121 120 0 0 1 0 0 0 1 0
|
||||
121 121 0 0 0 1 0 1 1 0
|
||||
121 121 1 1 0 1 0 1 1 1
|
||||
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,
|
||||
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
|
||||
@ -494,12 +494,13 @@ mbroverlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrtouches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
mbrwithin
|
||||
big,center
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
contains
|
||||
center,small
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
disjoint
|
||||
down3,left3,right3,up3
|
||||
@ -514,9 +515,10 @@ overlaps
|
||||
down,left,right,up
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
touches
|
||||
down2,left2,right2,up2
|
||||
big,center,down,down2,left,left2,right,right2,small,up,up2
|
||||
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
|
||||
within
|
||||
big,center
|
||||
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
|
||||
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
|
||||
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
|
||||
|
Reference in New Issue
Block a user