Name

ST_PointFromWKB — 使用给定的SRID从WKB创建几何图形

Synopsis

geometry ST_GeomFromWKB(bytea geom);

geometry ST_GeomFromWKB(bytea geom, integer srid);

描述

这个 ST_PointFromWKB 函数接受几何图形的众所周知的二进制表示形式和空间参考系ID( SRID ),并创建相应几何图形类型的实例-在本例中为 POINT 几何图形。此函数在SQL中扮演几何图形工厂的角色。

如果未指定SRID,则默认为0。 NULL 如果输入的是 bytea 并不代表 POINT 几何图形。

This method implements the OGC Simple Features Implementation Specification for SQL 1.1. s3.2.7.2

This method implements the SQL/MM specification. SQL-MM 3:6.1.9

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves

示例

SELECT
  ST_AsText(
        ST_PointFromWKB(
          ST_AsEWKB('POINT(2 5)'::geometry)
        )
  );
 st_astext
------------
 POINT(2 5)
(1 row)

SELECT
  ST_AsText(
        ST_PointFromWKB(
          ST_AsEWKB('LINESTRING(2 5, 2 6)'::geometry)
        )
  );
 st_astext
-----------

(1 row)

另请参阅

ST_GeomFromWKB, ST_LineFromWKB