ST_AsText converts a geometry object to a Well-Known Text (WKT) string. The Spatial Reference Identifier (SRID) is not included in the output.
Applicable engines and versions
ST_AsText is supported by all versions of LindormTable.
ST_AsText
Returns the WKT representation of a geometry object, without SRID metadata.
Syntax
string ST_AsText(geometry g)Parameters
| Parameter | Type | Description |
|---|---|---|
g | geometry | The geometry object to convert. Supported types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection. |
Note
Results support DOUBLE values with up to 16 decimal places.
Example
The following example converts a Point geometry to its WKT string at full precision.
SELECT ST_AsText(ST_GeomFromText('POINT(111.1111111 1.1111111)')) AS text;Output:
+-------------------------------+
| text |
+-------------------------------+
| POINT (111.1111111 1.1111111) |
+-------------------------------+