Search the MySQL manual:

11.4.2.1 Creating Geometry Values Using WKT Functions

MySQL provides a number of functions that take as input parameters a Well-Known Text representation (and, optionally, a spatial reference system identifier (SRID)), and return the corresponding geometry.

GeomFromText() accepts a WKT of any geometry type as its first argument. An implementation also provides type-specific construction functions for construction of geometry values of each geometry type.

GeomFromText(wkt[,srid])
GeometryFromText(wkt[,srid])
Constructs a geometry value of any type using its WKT representation and SRID.
PointFromText(wkt[,srid])
Constructs a POINT value using its WKT representation and SRID.
LineFromText(wkt[,srid])
LineStringFromText(wkt[,srid])
Constructs a LINESTRING value using its WKT representation and SRID.
PolyFromText(wkt[,srid])
PolygonFromText(wkt[,srid])
Constructs a POLYGON value using its WKT representation and SRID.
MPointFromText(wkt[,srid])
MultiPointFromText(wkt[,srid])
Constructs a MULTIPOINT value using its WKT representation and SRID.
MLineFromText(wkt[,srid])
MultiLineStringFromText(wkt[,srid])
Constructs a MULTILINESTRING value using its WKT representation and SRID.
MPolyFromText(wkt[,srid])
MultiPolygonFromText(wkt[,srid])
Constructs a MULTIPOLYGON value using its WKT representation and SRID.
GeomCollFromText(wkt[,srid])
GeometryCollectionFromText(wkt[,srid])
Constructs a GEOMETRYCOLLECTION value using its WKT representation and SRID.

The OpenGIS specification also describes optional functions for constructing Polygon or MultiPolygon values based on the WKT representation of a collection of rings or closed LineString values. These values may intersect. MySQL does not yet implement these functions:

BdPolyFromText(wkt,srid)
Constructs a Polygon value from a MultiLineString value in WKT format containing an arbitrary collection of closed LineString values.
BdMPolyFromText(wkt,srid)
Constructs a MultiPolygon value from a MultiLineString value in WKT format containing an arbitrary collection of closed LineString values.

User Comments

Add your own comment.