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_Aggr_Union

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

定义

ST_Aggr_Union 返回表示所有输入几何的并集的单个几何。

请注意,从 10.5.1 版本开始支持在 PostgreSQL 中配合使用 ST_Aggr_Union 和 ST_Geometry。

语法

Oracle 和 PostgreSQL

sde.st_aggr_union(geometry sde.st_geometry)

SQLite

st_aggr_union(geometry geometryblob)

返回类型

Oracle 和 PostgreSQL

ST_Geometry

SQLite

Geometryblob

示例

市场分析师需要创建表示销售量超过 1,000 的所有服务区的单个几何。在本示例中,您将创建 service_territories1 表并使用销售值数量填充表。然后使用 SELECT 语句中的 st_aggr_union 返回表示销售量等于或大于 1,000 的所有几何的并集的多面。

Oracle 和 PosgreSQL

--Create and populate tables.
CREATE TABLE service_territories1 (
 ID integer not null,
 UNITS number,
 SHAPE sde.st_geometry);
INSERT INTO service_territories1 (id, units, shape) VALUES (
 1, 
 1250,
 sde.st_polygon ('polygon ((20 30, 30 30, 30 40, 20 40, 20 30))', 4326)
);
 
INSERT INTO service_territories1 (id, units, shape) VALUES (
 2, 
 875,
 sde.st_polygon ('polygon ((30 30, 30 50, 50 50, 50 30, 30 30))', 4326)
);
 
INSERT INTO service_territories1 (id, units, shape) VALUES (
 3, 
 1700,
 sde.st_polygon ('polygon ((40 40, 40 60, 60 60, 60 40, 40 40))', 4326)
);
--Union of all geometries for which sales numbers are >= 1,000 units.
SELECT sde.st_astext(sde.st_aggr_union(shape)) UNION_SHAPE
  FROM service_territories1 
  WHERE units >= 1000;
UNION_SHAPE
MULTIPOLYGON  ((( 20.00000000 30.00000000, 30.00000000 30.00000000, 30.00000000
40.00000000, 20.00000000 40.00000000, 20.00000000 30.00000000)),(( 40.00000000 40.00000000, 
60.00000000 40.00000000, 60.00000000 60.00000000, 40.00000000 60.00000000, 
40.00000000 40.00000000)))

SQLite

--Create table, add geometry column to it, and populate table.
CREATE TABLE service_territories1 (
 id integer primary key autoincrement not null, 
 units number
);
SELECT AddGeometryColumn(
 NULL,
 'service_territories1',
 'shape',
 4326,
 'polygon',
 'xy',
 'null'
);
INSERT INTO service_territories1 (units, shape) VALUES (
 1250,
 st_polygon ('polygon ((20 30, 30 30, 30 40, 20 40, 20 30))', 4326)
);
 
INSERT INTO service_territories1 (units, shape) VALUES (
 875,
 st_polygon ('polygon ((30 30, 30 50, 50 50, 50 30, 30 30))', 4326)
);
 
INSERT INTO service_territories1 (units, shape) VALUES (
 1700,
 st_polygon ('polygon ((40 40, 40 60, 60 60, 60 40, 40 40))', 4326)
);
--Union of all geometries for which sales numbers are >= 1,000 units.
SELECT st_astext(st_aggr_union(shape)) 
 AS "UNION_SHAPE"
 FROM service_territories1 
 WHERE units >= 1000;
UNION_SHAPE
MULTIPOLYGON ((( 40.00000000 40.00000000, 60.00000000 40.00000000, 60.00000000 6
0.00000000, 40.00000000 60.00000000, 40.00000000 40.00000000)),(( 20.00000000 30
.00000000, 30.00000000 30.00000000, 30.00000000 40.00000000, 20.00000000 40.0000
0000, 20.00000000 30.00000000)))

相关主题

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