Name

ST_AsText — Returns the Well-known Text Representation of a geometric object

Synopsis

varchar ST_AsText(bytea Geometry);

Alias

AsText

Description

Returns the Well-known Text Representation of a geometric object

[Note]

ST_AsText is the reverse of ST_GeomFromText.

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
2.1.1.17.2.10.17.2.8.15.1.35

Examples

--The following example shows the use of the AsText function to extract the name and textual representation of
Geometry of all countries whose names begin with the letter K.

SELECT Name, AsText(Location) FROM Countries WHERE Name LIKE ‘K%’;


SELECT ST_AsText('01010000A0E6640000000000000000F03F000000000000F03F000000000000F03F');
--Result
POINT (1 1 1)

Related functions

ST_GeomFromText