Definition
ST_PolyFromText takes a well-known text representation and a spatial reference ID and returns an ST_Polygon.
Syntax
Oracle
sde.st_polyfromtext (wkt clob, srid integer)
sde.st_polyfromtext (wkt clob)
If you do not specify an SRID, the spatial reference defaults to 4326.
SQLite
st_polyfromtext (wkt text, srid int32)
st_polyfromtext (wkt text)
If you do not specify an SRID, the spatial reference defaults to 4326.
Return type
ST_Polygon
Example
The polygon_test table is created with the single polygon column.
The INSERT statement inserts a polygon into the polygon column using the ST_PolyFromText function.
Oracle
CREATE TABLE polygon_test (pl1 sde.st_geometry);
INSERT INTO polygon_test VALUES (
sde.st_polyfromtext ('polygon ((10.01 20.03, 10.52 40.11, 30.29 41.56, 31.78 10.74, 10.01 20.03))', 4326)
);
SQLite
CREATE TABLE polygon_test (id integer);
SELECT AddGeometryColumn(
NULL,
'polygon_test',
'pl1',
4326,
'polygon',
'xy',
'null'
);
INSERT INTO polygon_test VALUES (
1,
st_polyfromtext ('polygon ((10.01 20.03, 10.52 40.11, 30.29 41.56, 31.78 10.74, 10.01 20.03))', 4326)
);