- Categories:
ST_ ASEWKB¶
Given a value of type GEOGRAPHY or GEOMETRY, return the binary representation of that value in EWKB (extended well-known binary) format.
- See also:
Syntax¶
Arguments¶
geography_or_geometry_expressionThe argument must be an expression of type GEOGRAPHY or GEOMETRY.
Returns¶
A value of type BINARY.
Usage notes¶
- For GEOGRAPHY objects, the SRID in the return value is always 4326. See the note on EWKT handling.
- To return the output in WKB format, use ST_ASWKB instead.
Examples¶
GEOGRAPHY examples¶
The following example demonstrates the ST_ASEWKB function. For the EWKB output, it is assumed that the BINARY_OUTPUT_FORMAT
parameter is set to HEX (the default value for the parameter).
GEOMETRY examples¶
The example below demonstrates how to use the ST_ASEWKB function. The example returns the EWKB representations of two geometries that have different SRIDs.