Name

ST_WKTToSQL — Return a geometric object given its Well-known text Representation. This is an alias for ST_GeomFromText.

Synopsis

geometry ST_WKTToSQL(varchar WKT, integer SRID);

geometry ST_WKTToSQL(varchar WKT);

Alias

WKTToSQL

Description

The ST_WKTToSQL function takes a geometry textual representation and a Spatial Reference System ID (SRID) and creates an instance of the appropriate Geometry Type. If the SRID is not provided it defaults to -1.

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
---5.1.34

Examples

SELECT ST_WKTToSQL('POINT (-3.5 41.1)',4326);
--Result PostgreSQL
\011 \200\346\020\000\000\001\000\000\000\000\000\000\014\300\315\314\314\314\314\214D@

--Result H2
092080e6100000010000000000000cc0cdcccccccc8c4440

Related functions

ST_GeomFromText