ST_UnaryUnion

更新时间:2023-12-01 09:20:48

将一个复杂的Geometry对象进行内部聚合,返回一个新的Geometry对象。

语法

geometry ST_UnaryUnion(geometry geom, float8 gridsize defalut -1.0, cstring options default '{}'); 
geometry ST_UnaryUnion(geometry geom , cstring options);

参数

参数名称

描述

参数名称

描述

geom

Geometry对象,通常是复杂Geometry、MultiGeometry、GeometryCollection。

gridsize

指定网格大小,使得union时在相同网格内的顶点会直接合并,默认值为-1.0。表示不启用。

options

如果要开启并行执行,可通过options指定并行度。

并行度范围为1~64,格式为JSON字符串,例如'{"parallel": 4}'代表开启并行计算同时并行度为4,默认为空'{}',即串行执行。

示例

select st_area(st_union(geom)) from tableA where id = 1;
select st_area(st_union(geom, 0.005)) from tableA where id = 1;
select st_area(st_union(geom, '{"parallel": 4}'::cstring)) from tableA where id = 1;
  • 本页导读 (1)
  • 语法
  • 参数
  • 示例
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等