Returns the WKB representation of an ST_Geometry value.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsBinary()
If the st_geometry_asbinary_format option has its default value of 'WKB', the following returns the result 0x01b90b0000000000000000f03f000000000000004000000000000008400000000000001040. The server implicitly invokes the ST_AsBinary method when converting geometries to BINARY.
SELECT CAST( NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ) AS LONG BINARY)
The following returns the result 0x0101000000000000000000f03f0000000000000040. The Z and M values are omitted because version 1.1 of the OGC specification for WKB does not support these.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsBinary('WKB(Version=1.1;endian=little)')
The following returns the result 0x01010000e0e6100000000000000000f03f000000000000004000000000000008400000000000001040. The extended WKB contains the SRID.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsBinary('EWKB(endian=little)')
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.37