用户指南和参考

ST_StartPoint

ST_StartPoint 接受线条并返回该线条的第一点。

语法

db2gse.ST_StartPoint(c db2gse.ST_Curve)

返回类型

db2gse.ST_Point

示例

以下 CREATE TABLE 语句创建 STARTPOINT_TEST 表。 STARTPOINT_TEST 具有两列:GID 整数列(唯一地标识表的行)和 LN1 线条列。

CREATE TABLE STARTPOINT_TEST (gid integer, ln1 db2gse.ST_LineString)

下列 INSERT 语句将线条插入 LN1 列。 第一条线条没有 Z 坐标或度量单位,而第二个线条则两者都有。

INSERT INTO STARTPOINT_TEST VALUES(1,
db2gse.ST_LineFromText('linestring (10.02 20.01,23.73
21.92,30.10 40.23)', db2gse.coordref()..srid(0)))
 
INSERT INTO STARTPOINT_TEST VALUES(2,
db2gse.ST_LineFromText('linestring  zm (10.02 20.01 5.0 7.0,23.73 21.92 6.5 7.1,30.10
40.23 6.9 7.2)', db2gse.coordref()..srid(0)))

以下 SELECT 语句和相应结果集显示 ST_StartPoint 函数如何抽出每个线条的第一点。 ST_AsText 函数将该点转换为它的文本格式。列表中的第一点没有 Z 坐标或度量单位,而第二点则二者都具有,因为源线条具有。

SELECT gid, CAST(db2gse.ST_AsText(db2gse.ST_StartPoint (ln1)) as varchar(60))
"Startpoint"
FROM STARTPOINT_TEST
 
GID         Startpoint
----------- ------------------------------------------------------------
          1 POINT ( 10.02000000 20.01000000)
          2 POINT ZM ( 10.02000000 20.01000000 5.00000000 7.00000000)
 
  2 record(s) selected. 


[ 页的顶部 | 上一页 | 下一页 | 目录 | 索引 ]