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