ST_GeomFromEWKB

更新时间:
复制 MD 格式

Constructs a geometry object from an Extended Well-Known Binary (EWKB) string.

Syntax

geometry ST_GeomFromEWKB(bytea eWKB);

Parameters

ParameterDescription
eWKBThe EWKB string.

Usage notes

ST_GeomFromEWKB supports the following geometry types: circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.

Examples

The following examples parse the same EWKB hex string and return its text representation and spatial reference identifier (SRID).

Get the WKT representation:

SELECT ST_AsText(ST_GeomFromEWKB(E'\\x0101000020e61000000000000000005d400000000000004440'));
   st_astext
---------------
 POINT(116 40)
(1 row)

Get the SRID:

SELECT ST_SRID(ST_GeomFromEWKB(E'\\x0101000020e61000000000000000005d400000000000004440'));
 st_srid
---------
     4326
(1 row)

The EWKB string encodes a point at longitude 116, latitude 40, with SRID 4326 (WGS 84).