ST_Union
Signatures
Description
ST_Union
can be used as a scalar or an aggregate function.
Scalar function
Computes the union of one or more Geometries.
Input Geometries can be (MULTI)POINT
s, (MULTI)LINESTRING
s, (MULTI)POLYGON
s or GEOMETRYCOLLECTION
s.
Aggregate function
Computes the union of a set of Geometries.
geom
is a GEOMETRYCOLLECTION
resulting from an ST_Accum
operation on a table.
In both cases:
- If no input Geometriy is given, the result is
NULL
. - Output Geometries can be single or multiple.
Implements the OpenGIS Simple Features Implementation Specification for SQL version 1.2.1.
Examples
Scalar function
geomA Polygon | geomB Polygon |
---|---|
POLYGON((1 1, 7 1, 7 6, 1 6, 1 1)) | POLYGON((3 2, 8 2, 8 8, 3 8, 3 2)) |