ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

ST_Polygon

  • Definition
  • Syntax
  • Return type
  • Example

Definition

The ST_Polygon accessor function takes a well-known text (WKT) representation and a spatial reference ID (SRID) and generates an ST_Polygon.

Note:

When creating spatial tables that will be used with ArcGIS, it is best to create the column as ST_Geometry rather than specifying an ST_Geometry subtype, such as ST_Polygon.

Syntax

Oracle

sde.st_polygon (wkt clob, srid integer)

PostgreSQL

sde.st_polygon (wkt clob, srid integer)
sde.st_polygon (esri_shape bytea, srid integer)

SQLite

st_polygon (wkt text, srid int32)

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))', 4326)
);

PostgreSQL

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))', 4326)
);

SQLite

CREATE TABLE poly_test (id integerp1 geometryblob);

SELECT AddGeometryColumn(
 NULL,
 'poly_test',
 'p1',
 4326,
 'polygon',
 'xy',
 'null'
);

INSERT INTO poly_test VALUES (  
 1,
 st_polygon ('polygon ((10.01 20.03, 20.94 21.34, 35.93 10.04, 10.01 20.03))', 4326)
);

Related topics

  • Load the SQLite ST_Geometry library

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal