Spatial Analysis Functions
997
•
MBREqual(g1,g2)
[997]
Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two geometries
g1
and
g2
are the same.
•
MBRIntersects(g1,g2)
[997]
Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two geometries
g1
and
g2
intersect.
•
MBROverlaps(g1,g2)
[997]
Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two geometries
g1
and
g2
overlap. The term spatially overlaps is used if two geometries intersect and their intersection
results in a geometry of the same dimension but not equal to either of the given geometries.
•
MBRTouches(g1,g2)
[997]
Returns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two geometries
g1
and
g2
touch. Two geometries spatially touch if the interiors of the geometries do not intersect, but the
boundary of one of the geometries intersects either the boundary or the interior of the other.
•
MBRWithin(g1,g2)
[997]
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()
[996]
.
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 |
+--------------------+--------------------+
12.16.5.4.2. Functions That Test Spatial Relationships Between Geometries
The OpenGIS specification defines the following functions. They test the relationship between two
geometry values
g1
and
g2
.
The return values 1 and 0 indicate true and false, respectively.
Note
Currently, MySQL does not implement these functions according to the
specification. Those that are implemented return the same result as the
corresponding MBR-based functions.
•
Contains(g1,g2)
[997]
Returns 1 or 0 to indicate whether
g1
completely contains
g2
. This tests the opposite relationship as
Within()
[998]
.
•
Crosses(g1,g2)
[997]
Returns 1 if
g1
spatially crosses
g2
. Returns
NULL
if
g1
is a
Polygon
or a
MultiPolygon
, or if
g2
is a
Point
or a
MultiPoint
. Otherwise, returns 0.
The term spatially crosses denotes a spatial relation between two given geometries that has the
following properties:
• The two geometries intersect
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...