MySQL 5.6 Reference Manual Including MySQL NDB Cluster 7.3-7.4 Reference Guide
These functions take as arguments a Well-Known Text (WKT) representation and, optionally, a spatial reference system identifier (SRID). They return the corresponding geometry.
GeomFromText()
and
ST_GeomFromText()
accept a WKT
value of any geometry type as their first argument. Other
functions provide type-specific construction functions for
construction of geometry values of each geometry type.
For a description of WKT format, see Well-Known Text (WKT) Format.
GeomCollFromText(
,
wkt
[, srid
])GeometryCollectionFromText(
wkt
[, srid
])
ST_GeomCollFromText()
,
ST_GeometryCollectionFromText()
,
GeomCollFromText()
, and
GeometryCollectionFromText()
are synonyms. For more information, see the description of
ST_GeomCollFromText()
.
GeomFromText(
,
wkt
[, srid
])GeometryFromText(
wkt
[, srid
])
ST_GeomFromText()
,
ST_GeometryFromText()
,
GeomFromText()
, and
GeometryFromText()
are synonyms. For more information, see the description of
ST_GeomFromText()
.
LineFromText(
,
wkt
[, srid
])LineStringFromText(
wkt
[, srid
])
ST_LineFromText()
,
ST_LineStringFromText()
,
LineFromText()
, and
LineStringFromText()
are synonyms. For more information, see the description of
ST_LineFromText()
.
MLineFromText(
,
wkt
[, srid
])MultiLineStringFromText(
wkt
[, srid
])
Constructs a MultiLineString
value using
its WKT representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
MPointFromText(
,
wkt
[, srid
])MultiPointFromText(
wkt
[, srid
])
Constructs a MultiPoint
value using its WKT
representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
MPolyFromText(
,
wkt
[, srid
])MultiPolygonFromText(
wkt
[, srid
])
Constructs a MultiPolygon
value using its
WKT representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
ST_PointFromText()
and
PointFromText()
are synonyms.
For more information, see the description of
ST_PointFromText()
.
PolyFromText(
,
wkt
[, srid
])PolygonFromText(
wkt
[, srid
])
ST_PolyFromText()
,
ST_PolygonFromText()
,
PolyFromText()
, and
PolygonFromText()
are synonyms. For more information, see the description of
ST_PolyFromText()
.
ST_GeomCollFromText(
,
wkt
[, srid
])ST_GeometryCollectionFromText(
wkt
[, srid
])
Constructs a GeometryCollection
value using
its WKT representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
mysql>SET @g = "MULTILINESTRING((10 10, 11 11), (9 9, 10 10))";
mysql>SELECT ST_AsText(ST_GeomCollFromText(@g));
+--------------------------------------------+ | ST_AsText(ST_GeomCollFromText(@g)) | +--------------------------------------------+ | MULTILINESTRING((10 10,11 11),(9 9,10 10)) | +--------------------------------------------+
ST_GeomCollFromText()
,
ST_GeometryCollectionFromText()
,
GeomCollFromText()
, and
GeometryCollectionFromText()
are synonyms.
ST_GeomFromText(
,
wkt
[, srid
])ST_GeometryFromText(
wkt
[, srid
])
Constructs a geometry value of any type using its WKT representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
ST_GeomFromText()
,
ST_GeometryFromText()
,
GeomFromText()
, and
GeometryFromText()
are synonyms.
ST_LineFromText(
,
wkt
[, srid
])ST_LineStringFromText(
wkt
[, srid
])
Constructs a LineString
value using its WKT
representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
ST_LineFromText()
,
ST_LineStringFromText()
,
LineFromText()
, and
LineStringFromText()
are synonyms.
ST_PointFromText(
wkt
[, srid
])
Constructs a Point
value using its WKT
representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
ST_PointFromText()
and
PointFromText()
are synonyms.
ST_PolyFromText(
,
wkt
[, srid
])ST_PolygonFromText(
wkt
[, srid
])
Constructs a Polygon
value using its WKT
representation and SRID.
The result is NULL
if the geometry argument
is NULL
or not a syntactically well-formed
geometry.
ST_PolyFromText()
,
ST_PolygonFromText()
,
PolyFromText()
, and
PolygonFromText()
are synonyms.