5. Geospatial Functions : PolyFromText
 
Share this page                  
PolyFromText
POLYFROMTEXT(s string [, srid integer])
Alias: ST_POLYFROMTEXT
Returns a polygon that corresponds to the Well Known Text (WKT) in s. The SRID can optionally be specified. It is ‑1 by default.
Result type: geometry
Example:
SELECT ASTEXT(POLYFROMTEXT('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))'));
--------------------------------
col1
--------------------------------
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
--------------------------------