ST_AsHEXEWKB

更新时间:
复制 MD 格式

Returns the hex-encoded Extended Well-Known Binary (HEXEWKB) representation of a geometry object.

Syntax

text ST_AsHEXEWKB(geometry g1, text NDRorXDR);
text ST_AsHEXEWKB(geometry g1);

Parameters

ParameterDescription
g1The geometry object to convert.
NDRorXDRThe byte order of the output. Valid values: XDR (big-endian) and NDR (little-endian). Default value: NDR.

Usage notes

  • Supports circular strings and curves.

  • Supports 3D geometry. The Z coordinate of the input geometry is preserved in the output.

Examples

Convert a polygon to its HEXEWKB representation:

SELECT ST_AsHEXEWKB(ST_GeomFromText('POLYGON((1 1,1 2,2 2,2 1,1 1))',4326));

Output:

                         st_ashexewkb
---------------------------------------------------------------
 0103000020E61000000100000005000000000000000000F03F000000000000F03F000000000000F03F0000000000000040000000000000004000000000000000400000000000000040000000000000F03F000000000000F03F000000000000F03F
(1 row)