ST_X

定义

ST_X 将 ST_Point 作为输入参数以返回其 x 坐标。

语法

sde.st_x (pt1 sde.st_point)

返回类型

双精度型

示例

使用两个列创建 x_test 表:唯一标识行的 gid 列和 pt1 点列。

CREATE TABLE x_test (gid integer unique, pt1 sde.st_point);

INSERT 语句插入两行。一行是不带 z 坐标或度量值的点。另一列具有 z 坐标和度量值。

Oracle

INSERT INTO X_TEST VALUES (
1,
sde.st_pointfromtext ('point (10.02 20.01)', 0)
);

INSERT INTO X_TEST VALUES (
2,
sde.st_pointfromtext ('point zm(10.02 20.01 5 7)', 0)
);

PostgreSQL

INSERT INTO x_test VALUES (
1,
sde.st_point ('point (10.02 20.01)', 0)
);

INSERT INTO x_test VALUES (
2,
sde.st_point ('point zm(10.02 20.01 5 7)', 0)
);

查询列出了 gid 列和点的双精度 x 坐标。

Oracle

SELECT gid, sde.st_x (pt1) "The X coordinate"
FROM X_TEST;

       GID       The X coordinate

         1            10.02
         2            10.02

PostgreSQL

SELECT gid, sde.st_x (pt1) 
AS "The X coordinate"
FROM x_test;

       gid       The X coordinate

         1            10.02
         2            10.02

7/10/2012