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()
, andGeometryCollectionFromText()
are synonyms. For more information, see the description ofST_GeomCollFromText()
.GeomFromText(
,wkt
[,srid
])GeometryFromText(
wkt
[,srid
])ST_GeomFromText()
,ST_GeometryFromText()
,GeomFromText()
, andGeometryFromText()
are synonyms. For more information, see the description ofST_GeomFromText()
.LineFromText(
,wkt
[,srid
])LineStringFromText(
wkt
[,srid
])ST_LineFromText()
,ST_LineStringFromText()
,LineFromText()
, andLineStringFromText()
are synonyms. For more information, see the description ofST_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 isNULL
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 isNULL
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 isNULL
or not a syntactically well-formed geometry.ST_PointFromText()
andPointFromText()
are synonyms. For more information, see the description ofST_PointFromText()
.PolyFromText(
,wkt
[,srid
])PolygonFromText(
wkt
[,srid
])ST_PolyFromText()
,ST_PolygonFromText()
,PolyFromText()
, andPolygonFromText()
are synonyms. For more information, see the description ofST_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 isNULL
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()
, andGeometryCollectionFromText()
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 isNULL
or not a syntactically well-formed geometry.ST_GeomFromText()
,ST_GeometryFromText()
,GeomFromText()
, andGeometryFromText()
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 isNULL
or not a syntactically well-formed geometry.ST_LineFromText()
,ST_LineStringFromText()
,LineFromText()
, andLineStringFromText()
are synonyms.ST_PointFromText(
wkt
[,srid
])Constructs a
Point
value using its WKT representation and SRID.The result is
NULL
if the geometry argument isNULL
or not a syntactically well-formed geometry.ST_PointFromText()
andPointFromText()
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 isNULL
or not a syntactically well-formed geometry.ST_PolyFromText()
,ST_PolygonFromText()
,PolyFromText()
, andPolygonFromText()
are synonyms.