This topic describes the ST_LineFromWKB function. This function constructs a geometry object by using a Well-Known Binary (WKB) string and a spatial reference identifier (SRID).

Syntax

geometry  ST_LineFromWKB(bytea  WKB);
geometry  ST_LineFromWKB(bytea  WKB , integer  srid);

Parameters

Parameter Description
WKB The WKB string that you want to specify.
srid The SRID of the geometry object.

Description

  • If you do not specify an SRID, the default SRID 0 is used.
  • If the WKB string that you specify does not represent a LineString object, this function returns NULL.
  • If you can make sure that the WKB string you specify represents a LineString object, we recommend that you use the ST_GeomFromWKB function, which constructs a geometry object in a more efficient manner than the ST_LineFromWKB function.

Examples

SELECT ST_AsText(ST_LineFromWKB(E'\\x010200000002000000000000000000f03f000000000000004000000000000008400000000000001040'));
      st_astext
---------------------
 LINESTRING(1 2,3 4)
(1 row)