- Categories:
ST_ASWKT , ST_ASTEXT¶
Given a value of type GEOGRAPHY, return the text (VARCHAR) representation of that value in WKT (well-known text) format.
- See also:
Syntax¶
Use one of the following:
ST_ASWKT( <geography_expression> )
ST_ASTEXT( <geography_expression> )
Arguments¶
geography_expression
The argument must be an expression of type GEOGRAPHY.
Returns¶
A VARCHAR.
Usage Notes¶
ST_ASTEXT is an alias for ST_ASWKT.
To return the output in EWKT format, use ST_ASEWKT instead.
Examples¶
The following example demonstrates the ST_ASWKT 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_astext(g) from geospatial_table; +-------------------------------------+ | ST_ASTEXT(G) | |-------------------------------------| | POINT(-122.35 37.55) | | LINESTRING(-124.2 42,-120.01 41.99) | +-------------------------------------+select st_aswkt(g) from geospatial_table; +-------------------------------------+ | ST_ASWKT(G) | |-------------------------------------| | POINT(-122.35 37.55) | | LINESTRING(-124.2 42,-120.01 41.99) | +-------------------------------------+