Name

ST_AsEWKB — Returns the Extended Well-Known Binary (EWKB) representation of a Geometry object.

Synopsis

bytea ST_AsEWKB(bytea Geometry);

bytea ST_AsEWKB(bytea Geometry, text XDR/NDR);

Alias

AsEWKB

Description

Returns the Extended Well-Known Binary (EWKB) representation of a Geometry object. The EWKB format is a Postgis format that adds the Spatial Reference ID (SRID) to the OGC Well-Known Binary representation (WKB).

[Note]

The reverse function is ST_GeomFromEWKB

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

PostgreSQL
SELECT ST_AsEWKB(ST_GeomFromText('POINT(1 1 1)',25830));
                                             st_asewkb                                                 
-------------------------------------------------------------------------------------
\001\001\000\000\240\346d\000\000\000\000\000\000\000\000\360?\000\000\000\000\000\000\360?\000\000\000\000\000\000\360?
(1 row)
H2
SELECT ST_AsEWKB(ST_GeomFromText('POINT(1 1 1)',25830));
--Result
01010000a0e6640000000000000000f03f000000000000f03f000000000000f03f

Related functions

ST_GeomFromEWKB