All Products
Search
Document Center

MaxCompute:ST_ASBINARY

Last Updated:Aug 26, 2026

The ST_ASBINARY function converts a GEOGRAPHY value to a BINARY value in Well-Known Binary (WKB) format.

Syntax

BINARY ST_ASBINARY(GEOGRAPHY <value>)

Parameters

value: Required. A value of the GEOGRAPHY data type. You can use functions such as ST_GEOGPOINT, ST_GEOGFROMWKB, ST_GEOGFROMTEXT, ST_MAKELINE, and ST_MAKEPOLYGON to create GEOGRAPHY objects.

Return value

Returns the WKB representation of the input GEOGRAPHY value.

Examples

SELECT ST_ASBINARY(ST_GEOGPOINT(3, 4));

-- Result:
+-------------------------------------------------------------+
| _c0                                                         |
+-------------------------------------------------------------+
| =00=00=00=00=01@=08=00=00=00=00=00=01@=10=00=00=00=00=00=00 |
+-------------------------------------------------------------+

Related topics