This topic describes the ST_UnaryUnion function. This function aggregates a complex geometry object and returns a new geometry object.
Syntax
geometry ST_UnaryUnion(geometry geom, float8 gridsize default -1.0, cstring options default '{}');
geometry ST_UnaryUnion(geometry geom , cstring options);Parameters
Parameter Name | Description |
geom | The Geometry object. This is typically a complex Geometry, MultiGeometry, or GeometryCollection. |
gridsize | The grid size. Vertices in the same grid are merged during the union operation. The default value is -1.0, which disables this parameter. |
options | Use this parameter to enable parallel execution and specify the degree of parallelism. The degree of parallelism ranges from 1 to 64. The value must be a JSON string. For example, |
Examples
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;该文章对您有帮助吗?