ST_GEOMFROMWKB()
All functions > GEOSPATIAL > ST_GEOMFROMWKB()
Creates a GEOMETRY value from a WKB (Well Known Binary) byte string.
Signatures
WKB to geometry
Returns: A geometry value; the sub kind depends on the WKB content
ST_GEOMFROMWKB(wkb: BINARY) → GEOM_MULTIANY sql
| Parameter | Type | Required | Description |
|---|---|---|---|
wkb | BINARY | Yes | Well Known Binary representation of a geometry |
Signature notes:
- Accepts standard WKB and EWKB (extended WKB with SRID)
- Returns NULL if the input is NULL
- Raises an error if the WKB is malformed
- On Trino: transpiled to ST_GeomFromBinary
- On BigQuery: transpiled to ST_GEOGFROMWKB (returns GEOGRAPHY, not GEOMETRY)
Examples
FeatureQL
SELECT
f1 := ST_ASTEXT(ST_GEOMFROMWKB(ST_ASWKB(ST_GEOMPOINT(1.0e0, 2.0e0)))) -- Round-trip WKB for a point geometry
;Result
| f1 VARCHAR |
|---|
| POINT (1 2) |
On this page