Constructs a geometry object from a Well-Known Binary (WKB) value and an optional spatial reference identifier (SRID).
Syntax
geometry ST_GeomFromWKB(bytea geom);
geometry ST_GeomFromWKB(bytea geom, integer srid);Parameters
| Parameter | Type | Description |
|---|---|---|
geom | bytea | The WKB-encoded binary representation of the geometry. |
srid | integer | The spatial reference identifier (SRID) to assign to the geometry. If omitted, defaults to 0. |
Usage notes
Supports circular strings and curves.
Example
Convert a WKB value to its Well-Known Text (WKT) representation:
SELECT ST_AsText(ST_GeomFromWKB(E'\\x01010000000000000000005d400000000000004440'));Output:
st_astext
---------------
POINT(116 40)
(1 row)该文章对您有帮助吗?