ST_PointFromText

注注:

仅适用于 Oracle 和 SQLite;对于 PostgreSQL,请使用 ST_Point

定义

在 Oracle 中,ST_PointFromText 以点类型的熟知文本表示和空间参考 ID 作为输入参数,返回点对象。

语法

Oracle

sde.st_pointfromtext (wkt varchar2, srid integer)

SQLite

st_pointfromtext (wkt text, srid int32)

返回类型

ST_Point

示例

创建包含单个 ST_Point 列 pt1 的 point_test 表。

在调用 INSERT 语句将点插入到 pt1 列之前,首先使用 ST_Point 函数将点文本坐标转换为点格式。

Oracle

CREATE TABLE point_test (pt1 sde.st_geometry);
INSERT INTO POINT_TEST VALUES (
 sde.st_pointfromtext ('point (10.01 20.03)', 4326)
);

SQLite

CREATE TABLE pt_test (id integer);

SELECT AddGeometryColumn(
 NULL,
 'pt_test',
 'pt1',
 4326,
 'point',
 'xy',
 'null'
);
INSERT INTO pt_test VALUES (
 1,
 st_pointfromtext ('point (10.01 20.03)', 4326)
);

相关主题

5/25/2014