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.
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. This
includes functions in the following list other than
Distance()
and
Related()
.
Returns 1 or 0 to indicate whether
g1
completely containsg2
. This tests the opposite relationship asWithin()
.Returns 1 if
g1
spatially crossesg2
. ReturnsNULL
ifg1
is aPolygon
or aMultiPolygon
, or ifg2
is aPoint
or aMultiPoint
. Otherwise, returns 0.The term spatially crosses denotes a spatial relation between two given geometries that has the following properties:
The two geometries intersect
Their intersection results in a geometry that has a dimension that is one less than the maximum dimension of the two given geometries
Their intersection is not equal to either of the two given geometries
Returns 1 or 0 to indicate whether
g1
is spatially disjoint from (does not intersect)g2
.Returns as a double-precision number the shortest distance between any two points in the two geometries.
Returns 1 or 0 to indicate whether
g1
is spatially equal tog2
.Returns 1 or 0 to indicate whether
g1
spatially intersectsg2
.Returns 1 or 0 to indicate whether
g1
spatially overlapsg2
. 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.Returns 1 or 0 to indicate whether the spatial relationship specified by
pattern_matrix
exists betweeng1
andg2
. Returns –1 if the arguments areNULL
. The pattern matrix is a string. Its specification will be noted here if this function is implemented.Returns 1 or 0 to indicate whether
g1
spatially touchesg2
. 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.Returns 1 or 0 to indicate whether
g1
is spatially withing2
. This tests the opposite relationship asContains()
.