ST_LineString

定义

ST_LineString 是一个通过熟知文本表示构造线串的存取函数。

注注:

创建将用于 ArcGIS 的空间表时,最好将列创建为几何父类型(如 ST_Geometry),而不要指定一个 ST_Geometry 子类型,如 ST_LineString。

语法

Oracle

sde.st_linestring (wkt clob, srid integer)

PostgreSQL

sde.st_linestring (wkt text, srid integer)
sde.st_linestring (esri_shape bytea, srid integer)

SQLite

st_linestring (wkt text, srid int32)

返回类型

ST_LineString

示例

Oracle

CREATE TABLE lines_test (
 id smallint,
 geometry sde.st_geometry
);
 
INSERT INTO LINES_TEST (id, geometry) VALUES (
 1901,
 sde.st_linestring ('linestring (750 150, 750 750)', 4326)
);

SELECT id, sde.st_astext (geometry) Linestring
 FROM   LINES_TEST;

  ID  LINESTRING

1901  LINESTRING  (750.00000000 150.00000000, 
750.00000000 750.00000000)

PostgreSQL

CREATE TABLE lines_test (
 id serial,
 geometry sde.st_geometry
);
 
INSERT INTO lines_test (geometry) VALUES (
 sde.st_linestring ('linestring (750 150, 750 750)', 4326)
);

SELECT id, sde.st_astext (geometry)
 AS Linestring
 FROM lines_test;

  id  linestring

  1  LINESTRING  (750 150, 750 750)

SQLite

CREATE TABLE lines_test (
 id integer primary key autoincrement not null
);

SELECT AddGeometryColumn (
 NULL,
 'lines_test',
 'geometry',
 4326,
 'linestring',
 'xy',
 'null'
);
 
INSERT INTO lines_test (geometry) VALUES (
 st_linestring ('linestring (750 150, 750 750)', 4326)
);

SELECT id, st_astext (geometry)
 AS "Linestring"
 FROM lines_test;

  id  linestring

  1  LINESTRING  (750.00000000 150.00000000, 750.00000000 750.00000000)

相关主题

5/25/2014