Skip to content
πŸŽ‰ Apache Sedona 1.9.1 is out now! πŸ—ΊοΈ Geography SQL functions, Box2D & Box3D types, raster Python UDFs & more. Read the release notes β†’

ST_AsBinary

Introduction: Return the Well-Known Binary representation of a geometry

Since v2.0.0, measured geometries retain M in the output, including those read from WKT; earlier versions dropped M. Z/M layouts declared in WKB are preserved for empty points, lines, and polygons and for NaN ordinates. Collections with no members have no stored coordinate layout and are written as XY. The output does not include the SRID.

Format: ST_AsBinary (A: Geometry)

Return type: Binary

Since: v1.1.1

SQL Example

SELECT ST_AsBinary(ST_GeomFromWKT('POINT (1 1)'))

Output:

0101000000000000000000f87f000000000000f87f