ST_GEOMETRYFROMWKT
functionsupportedCore SQL functionsParses a WKT (well-known text) or EWKT (extended well-known text) input and returns a value of type GEOMETRY.
Syntax
supportedpartialnot supportednot scored
ST_GEOMETRYFROMWKT( <varchar_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMFROMWKT( <varchar_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMETRYFROMEWKT( <varchar_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMFROMEWKT( <varchar_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMETRYFROMTEXT( <varchar_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMFROMTEXT( <varchar_expression> [ , <srid> ] [ , <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. |
srid | optional | The integer value of the SRID to use. |
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 GEOMETRY.
Usage notes
- Issues an error if the input cannot be parsed as WKT or EWKT.
- For WKT input, if the srid argument is not specified, the resulting GEOMETRY object has the SRID set to 0.