Geometry
Property Analysis Functions
The OpenGIS specification defines the following functions, which MySQL does not yet implement. They should appear in future releases. When implemented, they will provide full support for spatial analysis, not just MBR-based support.
The functions operate on two geometry values g1
and g2
.
Contains(g1,g2)
g1
completely contains
g2
.
Crosses(g1,g2)
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:
Disjoint(g1,g2)
g1
is spatially disjoint
from (does not intersect) g2
.
Equals(g1,g2)
g1
is spatially equal to
g2
.
Intersects(g1,g2)
g1
spatially intersects
g2
.
Overlaps(g1,g2)
g1
spatially overlaps
g2
.
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.
Touches(g1,g2)
g1
spatially touches
g2
. 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.
Within(g1,g2)
g1
is spatially within
g2
.
Distance(g1,g2)
Related(g1,g2,pattern_matrix)
pattern_matrix
exists between g1
and g2
.
Returns -1 if the arguments are NULL
.
The pattern matrix is a string. Its specification will be noted here when this
function is implemented.