ArcGIS Server Banner

ST_Polygon

ST_Polygon

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback

Definition

ST_Polygon generates an ST_Polygon from a well-known text (WKT) representation and a spatial reference ID (SRID).

Syntax

Oracle

sde.st_polygon (wkt clob, srid integer)

PostgreSQL

st_polygon (wkt, srid integer)
st_polygon (esri_shape bytea, srid integer)

Return type

ST_Polygon

Example

The following CREATE TABLE statement creates the polygon_test tables, which have a single column, p1. Then the INSERT statement converts a ring (a polygon that is both closed and simple) into an ST_Polygon and inserts it into the p1 column using the ST_Polygon function.

Oracle

CREATE TABLE polygon_test (p1 sde.st_geometry);

INSERT INTO polygon_test VALUES (  
sde.st_polygon ('polygon ((10.01 20.03, 20.94 21.34, 35.93 10.04, 10.01 
20.03))', 0)
);

PostgreSQL

CREATE TABLE polygon_test (p1 st_geometry);

INSERT INTO polygon_test VALUES (  
st_polygon ('polygon ((10.01 20.03, 20.94 21.34, 35.93 10.04, 10.01 
20.03))', 0)
);

See Also

  • An overview of SQL functions used with ST_Geometry types