Categories:

Geospatial Functions

ST_ASEWKT

Given a value of type GEOGRAPHY, return the text (VARCHAR) representation of that value in EWKT (extended well-known text) format.

See also:

ST_ASWKT

Syntax

ST_ASEWKT( <geography_expression> )

Arguments

geography_expression

The argument must be an expression of type GEOGRAPHY.

Returns

A VARCHAR.

Usage Notes

Examples

The following example demonstrates the ST_ASEWKT function:

create table geospatial_table (g GEOGRAPHY);
insert into geospatial_table values
    ('POINT(-122.35 37.55)'), ('LINESTRING(-124.20 42.00, -120.01 41.99)');
select st_asewkt(g)
    from geospatial_table;
+-----------------------------------------------+
| ST_ASEWKT(G)                                  |
|-----------------------------------------------|
| SRID=4326;POINT(-122.35 37.55)                |
| SRID=4326;LINESTRING(-124.2 42,-120.01 41.99) |
+-----------------------------------------------+