ST_WKTToSQL

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

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

Syntax

ST_WKTToSQL(wktgeo[, srid[, computeMBR[, skiptest]]]);
wkt
The input geometry, in WKT representation.

Type: VARCHAR(ANY)

srid
The spatial reference identifier.

Type: INT4

Default: 4326

Returns

A value of type ST_GEOMETRY(ANY) that contains the output geometry.

Examples

SELECT inza..ST_AsText(inza..ST_WKBToSQL(inza..ST_AsBinary(inza..ST_WKTToSQL('POLYGON ((0 0, 11 0, 11 11, 0 11, 0 0))'))));

ST_ASTEXT
---------
POLYGON ((0 0, 11 0, 11 11, 0 11, 0 0))
(1 row)


SELECT inza..ST_AsText(inza..ST_WKBToSQL(inza..ST_AsBinary(inza..ST_WKTToSQL('LINESTRING(0 0, 3 4, -1 1)'))));
ST_ASTEXT
---------
LINESTRING (0 0, 3 4, -1 1)
(1 row)


SELECT inza..ST_AsText(inza..ST_WKBToSQL(inza..ST_AsBinary(inza..ST_Point(1, 5))));

ST_ASTEXT
-----------
POINT (1 5)
(1 row)