ST_Polygon

定义

ST_Polygon 存取器函数以熟知文本 (WKT) 表示和空间参考 ID (SRID) 作为输入参数,并生成 ST_Polygon 类型的对象。

注注:

创建将用于 ArcGIS 的空间表时,最好将列创建为 ST_Geometry 类型,而不要指定 ST_Geometry 的任一子类型,如 ST_Polygon。

语法

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)

返回类型

ST_Polygon

示例

下面的 CREATE TABLE 语句用于创建包含单一列 p1 的 polygon_test 表。INSERT 语句使用 ST_Polygon 函数将一个环(一个闭合且简单的面)转换为 ST_Polygon 对象并将此对象插入到 p1 列中。

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)
);

相关主题

5/25/2014