ST_LineFromText

注注:

仅支持 Oracle 和 SQLite;对于 PostgreSQL,请使用 ST_LineString

定义

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

语法

Oracle

sde.st_linefromtext (wkt clob, srid integer)

SQLite

st_linefromtext (wkt text, srid int32)

返回类型

ST_LineString

示例

创建一个包含单个 ln1 ST_LineString 列的 linestring_test 表。

此 INSERT 语句使用 ST_LineFromText 函数将 ST_LineString 插入到 ln1 列中。

Oracle

CREATE TABLE linestring_test (ln1 sde.st_geometry);
INSERT INTO LINESTRING_TEST VALUES (
 sde.st_linefromtext ('linestring (10.01 20.03, 35.93 19.04)', 4326)
);

SQLite

CREATE TABLE linestring_test (id integer);

SELECT AddGeometryColumn (
 NULL,
 'linestring_test',
 'ln1',
 4326,
 'linestring',
 'xy',
 'null'
);
INSERT INTO LINESTRING_TEST (id, ln1) VALUES (
 1,
 st_linefromtext ('linestring (10.01 20.03, 35.93 19.04)', 4326)
);

相关主题

5/25/2014