Constructs a LineString geometry object from a Well-Known Binary (WKB) value and an optional spatial reference identifier (SRID).
Syntax
geometry ST_LineFromWKB(bytea WKB);
geometry ST_LineFromWKB(bytea WKB, integer srid);Parameters
| Parameter | Type | Description |
|---|---|---|
WKB | bytea | The WKB value to parse. |
srid | integer | The SRID to assign to the geometry object. Defaults to 0 if omitted. |
Return value
Returns a geometry object. Returns NULL if the WKB value does not represent a LineString.
Usage notes
If the WKB value is known to represent aLineString, useST_GeomFromWKBinstead. It is more efficient thanST_LineFromWKB.
Examples
SELECT ST_AsText(ST_LineFromWKB(E'\\x010200000002000000000000000000f03f000000000000004000000000000008400000000000001040'));Output:
st_astext
---------------------
LINESTRING(1 2,3 4)
(1 row)该文章对您有帮助吗?