Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Returns the input GEOGRAPHY
or GEOMETRY
value in WKT format.
Syntax
st_astext ( geoExpr )
Arguments
geoExpr
: AGEOGRAPHY
orGEOMETRY
value.
Returns
A value of type STRING
.
The returned value is the WKT description of the input GEOGRAPHY
or GEOMETRY
value.
The function returns NULL
if the input is NULL
.
Examples
-- Export a 3DZ Cartesian point, given in GeoJSON format, in WKT format.
> SELECT st_text(to_geometry('{"type":"Point","coordinates":[2.718281828,3.141592653,100]}'))
POINT Z (2.718281828 3.141592653 100)
-- Export a 3DZ geographic point, given in GeoJSON format, in WKT format.
> SELECT st_text(to_geography('{"type":"Point","coordinates":[2.718281828,3.141592653,100]}'))
POINT Z (2.718281828 3.141592653 100)
Related functions
st_asbinary
functionst_asewkb
functionst_asewkt
functionst_asgeojson
functionst_aswkb
functionst_aswkt
functionst_geogfromgeojson
functionst_geogfromtext
functionst_geogfromwkb
functionst_geogfromwkt
functionst_geomfromewkb
functionst_geomfromgeojson
functionst_geomfromtext
functionst_geomfromwkb
functionst_geomfromwkt
functionto_geography
functionto_geometry
functiontry_to_geography
functiontry_to_geometry
function