ST_GEOGRAPHYFROMWKB
functionsupportedCore SQL functionsParses a WKB (well-known binary) or EWKB (extended well-known binary) input and returns a value of type GEOGRAPHY.
Syntax
supportedpartialnot supportednot scored
ST_GEOGRAPHYFROMWKB( <varchar_or_binary_expression> [ , <allow_invalid> ] )
ST_GEOGFROMWKB( <varchar_or_binary_expression> [ , <allow_invalid> ] )
ST_GEOGRAPHYFROMEWKB( <varchar_or_binary_expression> [ , <allow_invalid> ] )
ST_GEOGFROMEWKB( <varchar_or_binary_expression> [ , <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). |
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 WKB or EWKB.
- Issues an error if the input format is EWKB and the SRID is not 4326. See the note on EWKT and EWKB handling.