ST_AsText

Determine the Well-Known Text (WKT) representation of a geometry.

Does not return the SRID. ST_AsText does the reverse of ST_GeomFromText.

Syntax

ST_AsText(geo);
geo
The input geometry.

Type: ST_GEOMETRY(ANY)

Returns

A value of type VARCHAR(ANY) that contains the WKT representation of the input geometry.

Examples

 
select inza..ST_AsText(inza..ST_Point(1.0, 5.0));

ST_ASTEXT
-----------
POINT (1 5)
(1 row)
select inza..ST_AsText(inza..ST_WKTToSQL('POLYGON((10 10, 10 20, 20 20, 20 15, 10 10))'));

ST_ASTEXT
-----------
POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))
(1 row)