Skip to content

ST_Union

Returns a geometry that represents the point set union of two geometries.

Usage

geometry ST_Union(geomA: geometry, geomB: geometry)

Arguments

  • geomA (geometry): Input geometry
  • geomB (geometry): Input geometry

Examples

SELECT ST_Union(
    ST_GeomFromWKT('POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))'),
    ST_GeomFromWKT('POLYGON((1 0, 3 0, 3 2, 1 2, 1 0))')
);
┌──────────────────────────────────────────────────────────────────────────────┐
│ st_union(st_geomfromwkt(Utf8("POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))")),st_geomf │
│             romwkt(Utf8("POLYGON((1 0, 3 0, 3 2, 1 2, 1 0))")))…             │
╞══════════════════════════════════════════════════════════════════════════════╡
│ POLYGON((0 0,0 2,1 2,2 2,3 2,3 0,2 0,1 0,0 0))                               │
└──────────────────────────────────────────────────────────────────────────────┘