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 Section 11.5.3.1.1, “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.
MPointFromText(,
wkt[,srid])MultiPointFromText(
wkt[,srid])
Constructs a MultiPoint value using its WKT
representation and SRID.
MPolyFromText(,
wkt[,srid])MultiPolygonFromText(
wkt[,srid])
Constructs a MultiPolygon value using its
WKT representation and SRID.
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.
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_GeomCollFromText() and
ST_GeometryCollectionFromText()
were added in MySQL 5.6.1.
ST_GeomFromText(,
wkt[,srid])ST_GeometryFromText(
wkt[,srid])
Constructs a geometry value of any type using its WKT representation and SRID.
ST_GeomFromText(),
ST_GeometryFromText(),
GeomFromText(), and
GeometryFromText()
are synonyms.
ST_GeomFromText() and
ST_GeometryFromText()
were added in MySQL 5.6.1.
ST_LineFromText(,
wkt[,srid])ST_LineStringFromText(
wkt[,srid])
Constructs a LineString value using its WKT
representation and SRID.
ST_LineFromText(),
ST_LineStringFromText(),
LineFromText(), and
LineStringFromText()
are synonyms.
ST_LineFromText() and
ST_LineStringFromText()
were added in MySQL 5.6.1.
Constructs a Point value using its WKT
representation and SRID.
ST_PointFromText() and
PointFromText() are synonyms.
ST_PointFromText() was added in
MySQL 5.6.1.
ST_PolyFromText(,
wkt[,srid])ST_PolygonFromText(
wkt[,srid])
Constructs a Polygon value using its WKT
representation and SRID.
ST_PolyFromText(),
ST_PolygonFromText(),
PolyFromText(), and
PolygonFromText()
are synonyms.
ST_PolyFromText() and
ST_PolygonFromText()
were added in MySQL 5.6.1.