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_Y

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

定义

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

语法

Oracle 和 PostgreSQL

sde.st_y (point1 sde.st_point)

SQLite

double   st_y (point1  geometryblob)
geometry st_y (input_shape geometryblob, new_Yvalue double)

返回类型

双精度型

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

示例

创建 y_test 表,表中包含两列数据:用于唯一标识行的 gid 列,以及 pt1 点列。

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

SELECT 查询使用 ST_Y 函数返回每个点的 y 坐标。

Oracle

CREATE TABLE y_test (
 gid integer unique,
 pt1 sde.st_point
);
INSERT INTO Y_TEST VALUES (
 1,
 sde.st_pointfromtext ('point (10.02 20.02)', 4326)
);

INSERT INTO Y_TEST VALUES (
 2,
 sde.st_pointfromtext ('point zm(10.1 20.01 5.0 7.0)', 4326)
);
SELECT gid, sde.st_y (pt1) "The Y coordinate"
 FROM Y_TEST;

       GID     The Y coordinate

         1          20.02
         2          20.01

PostgreSQL

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

INSERT INTO y_test VALUES (
 2,
 sde.st_point ('point zm(10.1 20.01 5.0 7.0)', 4326)
);
SELECT gid, sde.st_y (pt1) 
 AS "The Y coordinate"
 FROM y_test;

       gid    The Y coordinate

         1          20.02
         2          20.01

SQLite

CREATE TABLE y_test (gid integer);
 
SELECT AddGeometryColumn(
 NULL,
 'y_test',
 'pt1',
 4326,
 'pointzm',
 'xyzm',
 'null'
);
INSERT INTO y_test VALUES (
 1,
 st_point ('point (10.02 20.02)', 4326)
);

INSERT INTO y_test VALUES (
 2,
 st_point ('point zm(10.1 20.01 5.0 7.0)', 4326)
);
SELECT gid, st_y (pt1) 
 AS "The Y coordinate"
 FROM y_test;

gid    The Y coordinate

1          20.02
2          20.01

ST_Y 函数也可以用于更新现有点的坐标值。在本例中,ST_Y 用于更新 y_test 中第二个点的 y 坐标值。

UPDATE y_test
 SET pt1=st_y(
  (SELECT pt1 FROM y_test WHERE gid=2),
  20.1
  )
 WHERE gid=2;

相关主题

  • 加载 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. | 隐私政策 | 法律声明