ST_GEOGFROMWKB

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

Normalization and invalid input handling are applied as descibed in the GEOGRAPHY type documentation.

Syntax

ST_GEOGFROMWKB(<WKB>)

Parameters

Parameter Description Supported input types
<WKB> WKB representation of the GEOGRAPHY object. BYTEA

Return Type

ST_GEOGFROMWKB returns a value of type GEOGRAPHY.

Example

The following code example constructs a Point in the GEOGRAPHY data type from a WKB byte string and converts it to WKT format:

SELECT ST_ASTEXT(ST_GEOGFROMWKB('\x01010000003d94479a127f52c0502f80fb03614440'::BYTEA)) AS result

Returns

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