Constructs a LineString geometry object from a Well-Known Binary (WKB) value and an optional spatial reference identifier (SRID).
Syntax
geometry ST_LinestringFromWKB(bytea WKB);
geometry ST_LinestringFromWKB(bytea WKB , integer srid);Parameters
| Parameter | Description |
|---|---|
| WKB | The WKB representation of the LineString geometry. |
| srid | The SRID to assign to the geometry object. |
Description
If no SRID is specified, the default SRID 0 is used.
If the WKB value does not represent a LineString object, this function returns NULL.
If the WKB value is confirmed to represent a LineString object, use ST_GeomFromWKB instead, which constructs a geometry object more efficiently.
This function is equivalent to ST_LineFromWKB.
Examples
SELECT ST_AsText(ST_LineFromWKB(E'\\x010200000002000000000000000000f03f000000000000004000000000000008400000000000001040'));
st_astext
---------------------
LINESTRING(1 2,3 4)
(1 row)该文章对您有帮助吗?