名称

ST_LineFromWKB — Creates a LINESTRING from a WKB representation, optionally using a given SRID.

大纲

geometry ST_LineFromWKB(bytea WKB);

geometry ST_LineFromWKB(bytea WKB, integer srid);

描述

The ST_LineFromWKB function takes a Well-Known Binary (WKB) representation of a geometry and an optional Spatial Reference System ID (SRID), and creates a LINESTRING geometry. It is a type-specific geometry factory in SQL.

If an SRID is not specified, it defaults to 0. NULL is returned if the input bytea does not represent a LINESTRING geometry.

[注意]

OGC 规范 3.2.6.2 - 可选 SRID 用于规范。

[注意]

If you know all your geometries are LINESTRINGs, it is more efficient to use ST_GeomFromWKB directly. This function calls ST_GeomFromWKB and adds validation that the result is a LINESTRING.

此方法实现了 SQL 1.1 的 OGC 简单功能规范。 s3.2.6.2

该方法实现了SQL/MM规范。 SQL-MM 3: 7.2.9

示例

Code
SELECT ST_LineFromWKB(
    ST_AsBinary(ST_GeomFromText('LINESTRING(1 2,3 4)'))
) AS aline,
ST_LineFromWKB(
    ST_AsBinary(ST_GeomFromText('POINT(1 2)'))
) IS NULL AS null_return;
栅格输出
aline                 | null_return
------------------------------------
LINESTRING(1 2,3 4)  | t
                
Figure
Geometry figure for visual-st-linefromwkb-01