ArcGIS Desktop

  • 文档
  • 支持

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

ST_X

  • 定义
  • 语法
  • 返回类型
  • 示例

定义

ST_X 以 ST_Point 作为输入参数,返回其 x 坐标。在 SQLite 中,ST_X 也可以更新 ST_Point 的 x 坐标。

语法

Oracle 和 PostgreSQL

sde.st_x (point1 sde.st_point)

SQLite

st_x (point1 geometryblob)
st_x (input_point geometryblob, new_Xvalue double)

返回类型

双精度型

ST_X 函数可用于 SQLite 更新点的 x 坐标。在这种情况下,将返回 geometryblob。

示例

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

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

SELECT 查询使用 ST_X 函数获取每个点要素的 x 坐标。

Oracle

CREATE TABLE x_test (
 gid integer unique,
 pt1 sde.st_point
);
INSERT INTO X_TEST VALUES (
 1,
 sde.st_pointfromtext ('point (10.02 20.01)', 4326)
);

INSERT INTO X_TEST VALUES (
 2,
 sde.st_pointfromtext ('point zm(10.1 20.01 5 7)', 4326)
);
SELECT gid, sde.st_x (pt1) "The X coordinate"
 FROM X_TEST;

       GID       The X coordinate

         1            10.02
         2            10.10

PostgreSQL

CREATE TABLE x_test (
 gid integer unique,
 pt1 sde.st_point
);
INSERT INTO x_test VALUES (
 1,
 sde.st_point ('point (10.02 20.01)', 4326)
);

INSERT INTO x_test VALUES (
 2,
 sde.st_point ('point zm(10.1 20.01 5 7)', 4326)
);
SELECT gid, sde.st_x (pt1) 
 AS "The X coordinate"
 FROM x_test;

       gid       The X coordinate

         1            10.02
         2            10.10

SQLite

CREATE TABLE x_test (gid integer);

SELECT AddGeometryColumn(
 NULL,
 'x_test',
 'pt1',
 4326,
 'pointzm',
 'xyzm',
 'null'
);
INSERT INTO x_test VALUES (
 1,
 st_point ('point (10.02 20.01)', 4326)
);

INSERT INTO x_test VALUES (
 2,
 st_point ('point zm(10.1 20.01 5 7)', 4326)
);
SELECT gid, st_x (pt1) 
 AS "The X coordinate"
 FROM x_test;

       gid       The X coordinate

         1            10.02
         2            10.10

ST_X 函数也可以用于更新现有点的坐标值。在本例中,ST_X 用于更新 x_test 中第一个点的 x 坐标值。

UPDATE x_test
 SET pt1=st_x(
  (SELECT pt1 FROM x_test WHERE gid=1),
  10.04
  )
 WHERE gid=1;

相关主题

  • 加载 SQLite ST_Geometry 库

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2018 Esri. | 隐私政策 | 法律声明