ST_WKTToWKB

Create a Well-Known Binary (WKB) geometry that corresponds to a Well-Known Text (WKT) geometry.

ST_WKTToWKB is exactly the same as ST_GeomFromWKT, and does the reverse of ST_AsText.

Syntax

ST_WKTToWKB(wktgeo);
wktgeo
The input geometry.

Type: VARBINARY(ANY)

Returns

A value of type VARCHAR(ANY) that contains the WKB representation of the input WKT geometry.

Examples

SELECT inza..ST_WKBToWKT(inza..ST_WKTToWKB('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))'));
 
ST_WKBTOWKT
-----------------------------------------------
POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))
(1 row)