Skip to main content
Return the Extended Well-Known Text representation of a geometry. EWKT is an extended version of WKT which includes the SRID of the geometry. The format originated in PostGIS but is supported by many GIS tools. If the geometry is lacking SRID a WKT format is produced. See ST_SetSRID It will support M coordinate if present since v1.5.0.

Signatures

ST_AsEWKT (A: Geometry)

Parameters

A
Geometry
required
The input geometry.

Return type

A string representation.

Examples

SELECT ST_AsEWKT(ST_SetSrid(ST_GeomFromWKT('POLYGON((0 0,0 1,1 1,1 0,0 0))'), 4326))
SRID=4326;POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))
SELECT ST_AsEWKT(ST_MakePointM(1.0, 1.0, 1.0))
POINT M(1 1 1)
SELECT ST_AsEWKT(ST_MakePoint(1.0, 1.0, 1.0, 1.0))
POINT ZM(1 1 1 1)