DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK

(mysql.info.gz) Relations on geometry MBR

Info Catalog (mysql.info.gz) Functions for testing spatial relations between geometric objects (mysql.info.gz) Analysing spatial information (mysql.info.gz) Functions that test spatial relationships between geometries

18.5.5 Relations on Geometry Minimal Bounding Rectangles (MBRs)
---------------------------------------------------------------

MySQL provides some functions that can test relations between minimal
bounding rectangles of two geometries `g1' and `g2'.  They include:

`MBRContains(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangle of G1 contains the Minimum Bounding Rectangle of G2.

mysql> SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
mysql> SET @g2 = GeomFromText('Point(1 1)');
mysql> SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);
----------------------+----------------------+
| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |
+----------------------+----------------------+
|                    1 |                    0 |
+----------------------+----------------------+

`MBRDisjoint(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangles of the two geometries G1 and G2 are disjoint (do not
intersect).

`MBREqual(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangles of the two geometries G1 and G2 are the same.

`MBRIntersects(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangles of the two geometries G1 and G2 intersect.

`MBROverlaps(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangles of the two geometries G1 and G2 overlap.

`MBRTouches(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangles of the two geometries G1 and G2 touch.

`MBRWithin(G1,G2)'
Returns 1 or 0 to indicate whether or not the Minimum Bounding
Rectangle of G1 is within the Minimum Bounding Rectangle of G2.

mysql> SET @g1 = GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
mysql> SET @g2 = GeomFromText('Polygon((0 0,0 5,5 5,5 0,0 0))');
mysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);
+--------------------+--------------------+
| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |
+--------------------+--------------------+
|                  1 |                  0 |
+--------------------+--------------------+

Info Catalog (mysql.info.gz) Functions for testing spatial relations between geometric objects (mysql.info.gz) Analysing spatial information (mysql.info.gz) Functions that test spatial relationships between geometries
automatically generated byinfo2html