ST_GEOMETRYFROMWKB
functionsupportedCore SQL functionsParses a WKB (well-known binary) or EWKB (extended well-known binary) input and returns a value of type GEOMETRY.
Syntax
supportedpartialnot supportednot scored
ST_GEOMETRYFROMWKB( <varchar_or_binary_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMFROMWKB( <varchar_or_binary_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMETRYFROMEWKB( <varchar_or_binary_expression> [ , <srid> ] [ , <allow_invalid> ] )
ST_GEOMFROMEWKB( <varchar_or_binary_expression> [ , <srid> ] [ , <allow_invalid> ] )
Parameters
| Name | Required | Description |
|---|---|---|
varchar_or_binary_expression | required | The argument must be a string or binary expression in WKB or EWKB that represents a valid geospatial object. A string expression must be in hexadecimal format (without a leading 0x). |
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 WKB or EWKB.
- For WKB input, if the srid argument is not specified, the resulting GEOMETRY object has the SRID set to 0.