ST_GEOGRAPHYFROMWKT
functionsupportedCore SQL functionsParses a WKT (well-known text) or EWKT (extended well-known text) input and returns a value of type GEOGRAPHY.
Syntax
supportedpartialnot supportednot scored
ST_GEOGRAPHYFROMWKT( <varchar_expression> [ , <allow_invalid> ] )
ST_GEOGFROMWKT( <varchar_expression> [ , <allow_invalid> ] )
ST_GEOGRAPHYFROMEWKT( <varchar_expression> [ , <allow_invalid> ] )
ST_GEOGFROMEWKT( <varchar_expression> [ , <allow_invalid> ] )
ST_GEOGRAPHYFROMTEXT( <varchar_expression> [ , <allow_invalid> ] )
ST_GEOGFROMTEXT( <varchar_expression> [ , <allow_invalid> ] )
Parameters
| Name | Required | Description |
|---|---|---|
varchar_expression | required | The argument must be a string expression in WKT or EWKT that represents a valid geospatial object. |
allow_invalid | optional | If TRUE, specifies that the function returns a GEOGRAPHY or GEOMETRY object, even when the input shape isn’t valid and can’t be repaired. For more information, see Specifying how invalid geospatial shapes are handled. |
Returns
The function returns a value of type GEOGRAPHY.
Usage notes
- Issues an error if the input cannot be parsed as WKT or EWKT.
- Issues an error if the input format is EWKT and the SRID is not 4326. See the note on EWKT and EWKB handling.
- For the coordinates in WKT, EWKT, and GeoJSON, longitude appears before latitude (for example, POINT(lon lat)).