Creating Geometry Values Using WKT Functions
MySQL provides a number of functions that take as arguments a Well-Known Text representation and, optionally, a spatial reference system identifier (SRID). They 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.
GeomCollFromText(,wkt[,srid])GeometryCollectionFromText(wkt[,srid])Constructs a
GEOMETRYCOLLECTIONvalue using its WKT representation and SRID.GeomFromText(,wkt[,srid])GeometryFromText(wkt[,srid])Constructs a geometry value of any type using its WKT representation and SRID.
LineFromText(,wkt[,srid])LineStringFromText(wkt[,srid])Constructs a
LINESTRINGvalue using its WKT representation and SRID.MLineFromText(,wkt[,srid])MultiLineStringFromText(wkt[,srid])Constructs a
MULTILINESTRINGvalue using its WKT representation and SRID.MPointFromText(,wkt[,srid])MultiPointFromText(wkt[,srid])Constructs a
MULTIPOINTvalue using its WKT representation and SRID.MPolyFromText(,wkt[,srid])MultiPolygonFromText(wkt[,srid])Constructs a
MULTIPOLYGONvalue using its WKT representation and SRID.PointFromText(wkt[,srid])Constructs a
POINTvalue using its WKT representation and SRID.PolyFromText(,wkt[,srid])PolygonFromText(wkt[,srid])Constructs a
POLYGONvalue using its WKT representation and SRID.
The OpenGIS specification also defines the following optional functions, which MariaDB does not implement. These functions construct Polygon or MultiPolygon values based on the WKT representation of a collection of rings or closed LineString values. These values may intersect.
BdMPolyFromText(wkt,srid)Constructs a
MultiPolygonvalue from aMultiLineStringvalue in WKT format containing an arbitrary collection of closedLineStringvalues.BdPolyFromText(wkt,srid)Constructs a
Polygonvalue from aMultiLineStringvalue in WKT format containing an arbitrary collection of closedLineStringvalues.