Geometry
Property Analysis Functions
Point
Property Analysis Functions
LineString
Property Analysis Functions
MultiLineString
Property Analysis Functions
Polygon
Property Analysis Functions
MultiPolygon
Property Analysis Functions
GeometryCollection
Property Analysis Functions
The functions listed in this ssection do not restrict their argument and accept a geometry value of any type.
GeometryType(g)
g
is a member.
The name will correspond to one of the instantiable Geometry
subclasses.
mysql> SELECT GeometryType(GeomFromText('POINT(1 1)')); +------------------------------------------+ | GeometryType(GeomFromText('POINT(1 1)')) | +------------------------------------------+ | POINT | +------------------------------------------+
Dimension(g)
g
. The result
can be -1, 0, 1, or 2. (The meaning of these values is given in
section 11.2.2 Class Geometry
.)
mysql> SELECT Dimension(GeomFromText('LineString(1 1,2 2)')); +------------------------------------------------+ | Dimension(GeomFromText('LineString(1 1,2 2)')) | +------------------------------------------------+ | 1 | +------------------------------------------------+
SRID(g)
g
.
mysql> SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); +-----------------------------------------------+ | SRID(GeomFromText('LineString(1 1,2 2)',101)) | +-----------------------------------------------+ | 101 | +-----------------------------------------------+
Envelope(g)
g
.
The result is returned as a polygon value.
mysql> SELECT AsText(Envelope(GeomFromText('LineString(1 1,2 2)'))); +-------------------------------------------------------+ | AsText(Envelope(GeomFromText('LineString(1 1,2 2)'))) | +-------------------------------------------------------+ | POLYGON((1 1,2 1,2 2,1 2,1 1)) | +-------------------------------------------------------+The polygon is defined by the corner points of the bounding box:
POLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))
The OpenGIS specification also defines the following functions, which MySQL does not yet implement:
Boundary(g)
g
.
IsEmpty(g)
g
is the empty geometry, 0 if it is not
empty, and -1 if the argument is NULL
.
If the geometry is empty, it represents the empty point set.
IsSimple(g)
g
has no anomalous geometric points,
such as self intersection or self tangency. IsSimple()
returns 0 if the
argument is not simple, and -1 if it is NULL
.
The description of each instantiable geometric class given earlier in
the chapter includes the specific conditions that cause an instance of
that class to be classified as not simple.