ST_GEOGFROMTEXT

Constructs a GEOGRAPHY object from a Well-Known Text (WKT) string. The extended WKT format is supported only for Spatial Reference Identifier (SRID) 4326, which corresponds to the WGS84 coordinate system.

Syntax

ST_GEOGFROMTEXT(<WKT>)

Parameters

Parameter Description Supported input types
<WKT> A WKT string to convert to a GEOGRAPHY object. TEXT

Return Type

ST_GEOGFROMTEXT returns a value of type GEOGRAPHY.

Example

The following code example constructs a Point from a WKT string describing 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

Returns

result (TEXT)
‘POINT(-73.98551041593687 40.75793403395676)’