Description
The ST_Union
function returns a geometry object which represents the union
of two input geometry objects.
Syntax
ST_Union(WritableGeometry geometry1, WritableGeometry geometry2)
Parameters
Parameter |
Type |
Description |
geometry1
|
WritableGeometry |
The first instance of a WritableGeometry. |
geometry2
|
WritableGeometry |
The second instance of a WritableGeometry. |
Return Values
Return Type |
Description |
WritableGeometry |
The geometry that represents the union of the input geometries. |
Examples
SELECT ST_Union(ST_GeomFromWKT(geometry1, 'epsg:4326'), ST_GeomFromWKT(geometry2, 'epsg:4326')) FROM table;
SELECT ST_ToWKT(ST_Union(ST_GeomFromWKT(t1.geometry,'epsg:4267'), ST_GeomFromWKT(t2.geometry,'epsg:4267')))
FROM table1 t1, table2 t2;