ST_GEOGFROMWKB()
All functions > GEOSPATIAL > ST_GEOGFROMWKB()
Creates a GEOGRAPHY value from a WKB (Well Known Binary) byte string. Coordinates are interpreted as lon/lat in WGS84.
Signatures
WKB to geography
Returns: A geography value; the sub kind depends on the WKB content
ST_GEOGFROMWKB(wkb: BINARY) → GEOG_MULTIANY sql
| Parameter | Type | Required | Description |
|---|---|---|---|
wkb | BINARY | Yes | Well Known Binary representation of a geography |
Signature notes:
- Coordinates are interpreted as longitude, latitude in WGS84
- Returns NULL if the input is NULL
- Raises an error if the WKB is malformed
- On Trino: transpiled to to_spherical_geography(ST_GeomFromBinary(...))
Examples
FeatureQL
SELECT
f1 := ST_ASTEXT(ST_GEOGFROMWKB(ST_ASWKB(ST_GEOGPOINT(-122.4194, 37.7749)))) -- Round-trip WKB for a point geography
;Result
| f1 VARCHAR |
|---|
| POINT (-122.4194 37.7749) |
On this page