📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_GEOMETRYFROMWKB



Parses a WKB(well-known-binary) or EWKB(extended well-known-binary) input and returns a value of type GEOMETRY.

Syntax

ST_GEOMETRYFROMWKB(<string>, [<srid>]) ST_GEOMETRYFROMWKB(<binary>, [<srid>])

Aliases

Arguments

ArgumentsDescription
<string>The argument must be a string expression in WKB or EWKB in hexadecimal format.
<binary>The argument must be a binary expression in WKB or EWKB format.
<srid>The integer value of the SRID to use.

Return Type

Geometry.

Examples

SELECT ST_GEOMETRYFROMWKB( '0101000020797f000066666666a9cb17411f85ebc19e325641' ) AS pipeline_geometry; ┌────────────────────────────────────────┐ │ pipeline_geometry │ ├────────────────────────────────────────┤ │ SRID=32633;POINT(389866.35 5819003.03) │ └────────────────────────────────────────┘ SELECT ST_GEOMETRYFROMWKB( FROM_HEX('0101000020797f000066666666a9cb17411f85ebc19e325641'), 4326 ) AS pipeline_geometry; ┌───────────────────────────────────────┐ │ pipeline_geometry │ ├───────────────────────────────────────┤ │ SRID=4326;POINT(389866.35 5819003.03) │ └───────────────────────────────────────┘

Was this page helpful?