ST_PolyFromText

注注:

仅 Oracle 和 SQLite

定义

ST_PolyFromText 以熟知文本表示和空间参考 ID 作为输入参数,返回 ST_Polygon 类型的对象。

语法

Oracle

sde.st_polyfromtext (wkt clob, srid integer)

SQLite

st_polyfromtext (wkt text, srid int32)

返回类型

ST_Polygon

示例

创建包含单个面列的 polygon_test 表。

INSERT 语句使用 ST_PolyFromText 函数将面插入到面列中。

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

相关主题

5/25/2014