DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK

(mysql.info.gz) Functions that test spatial relationships between geometries

Info Catalog (mysql.info.gz) Relations on geometry MBR (mysql.info.gz) Analysing spatial information
```
18.5.6 Functions That Test Spatial Relationships Between Geometries
-------------------------------------------------------------------

The OpenGIS specification defines the following functions. Currently,
MySQL does not implement them 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()'.

These functions may be implemented in future releases with full support
for spatial analysis, not just MBR-based support.

The functions operate on two geometry values `g1' and `g2'.

`Contains(G1,G2)'
Returns 1 or 0 to indicate whether or not G1 completely contains
G2.

`Crosses(G1,G2)'
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

* 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

`Disjoint(G1,G2)'
Returns 1 or 0 to indicate whether or not G1 is spatially disjoint
from (does not intersect) G2.

`Distance(G1,G2)'
Returns as a double-precision number the shortest distance between
any two points in the two geometries.

`Equals(G1,G2)'
Returns 1 or 0 to indicate whether or not G1 is spatially equal to
G2.

`Intersects(G1,G2)'
Returns 1 or 0 to indicate whether or not G1 spatially intersects
G2.

`Overlaps(G1,G2)'
Returns 1 or 0 to indicate whether or not 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.

`Related(G1,G2,PATTERN_MATRIX)'
Returns 1 or 0 to indicate whether or not the spatial relationship
specified by 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 if this function is implemented.

`Touches(G1,G2)'
Returns 1 or 0 to indicate whether or not 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)'
Returns 1 or 0 to indicate whether or not G1 is spatially within
G2.

```
Info Catalog (mysql.info.gz) Relations on geometry MBR (mysql.info.gz) Analysing spatial information
automatically generated byinfo2html