Топ-100
top of page
Волнистый абстрактный фон
CerebroSQL

MBRWITHIN

База данных: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Topic

MBRWithin(g1, g2)

Returns 1 or 0 to indicate whether the minimum bounding rectangle of g1
is within the minimum bounding rectangle of g2. This tests the opposite
relationship as MBRContains().

MBRWithin() handles its arguments as described in the introduction to
this section.

URL: https://dev.mysql.com/doc/refman/8.0/en/spatial-relation-functions-mbr.html

Example

mysql> SET @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
mysql> SET @g2 = ST_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 |
+--------------------+--------------------+

bottom of page