Converts shapes of the GEOGRAPHY data type to the Well-Known Text (WKT) format.
Syntax
Parameters
| Parameter | Description | Supported input types |
|---|
<object> | The GEOGRAPHY object to convert to WKT format. | GEOGRAPHY |
Return Type
ST_ASTEXT returns a value of type TEXT.
Example
The following code example creates a GEOGRAPHY object from the WKT representation of a Point at specified longitude and latitude coordinates and converts it to WKT format:
SELECT ST_ASTEXT(ST_GEOGFROMTEXT('POINT(-73.98551041593687 40.75793403395676)')) AS result;
| result text |
|---|
| POINT(-73.98551041593687 40.75793403395676) |
Rows: 1Execution time: 6.66ms