📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_ASEWKT



Converts a GEOMETRY or GEOGRAPHY object into a EWKT(extended well-known-text) format representation.

Syntax

ST_ASEWKT(<geometry_or_geography>)

Arguments

ArgumentsDescription
<geometry_or_geography>The argument must be an expression of type GEOMETRY or GEOGRAPHY.

Return Type

String.

Examples

GEOMETRY examples

SELECT ST_ASEWKT( ST_GEOMETRYFROMWKT( 'SRID=4326;LINESTRING(400000 6000000, 401000 6010000)' ) ) AS pipeline_ewkt; ┌─────────────────────────────────────────────────────┐ │ pipeline_ewkt │ ├─────────────────────────────────────────────────────┤ │ SRID=4326;LINESTRING(400000 6000000,401000 6010000) │ └─────────────────────────────────────────────────────┘ SELECT ST_ASEWKT( ST_GEOMETRYFROMWKT( 'SRID=4326;POINT(-122.35 37.55)' ) ) AS pipeline_ewkt; ┌────────────────────────────────┐ │ pipeline_ewkt │ ├────────────────────────────────┤ │ SRID=4326;POINT(-122.35 37.55) │ └────────────────────────────────┘

GEOGRAPHY examples

SELECT ST_ASEWKT( ST_GEOGFROMWKT( 'SRID=4326;POINT(-122.35 37.55)' ) ) AS pipeline_ewkt; ╭────────────────────────────────╮ │ pipeline_ewkt │ ├────────────────────────────────┤ │ SRID=4326;POINT(-122.35 37.55) │ ╰────────────────────────────────╯

Was this page helpful?