Skip to content

ST_Boundary

Returns the closure of the combinatorial boundary of this Geometry.

Usage

geometry ST_Boundary(geom: geometry)

Arguments

  • geom (geometry): Input geometry

Description

For a polygon, the boundary is the exterior and interior rings; for a linestring it is the endpoints.

Examples

SELECT ST_Boundary(ST_GeomFromWKT('POLYGON((1 1,0 0, -1 1, 1 1))'));
┌────────────────────────────────────────────────────────────────────┐
│ st_boundary(st_geomfromwkt(Utf8("POLYGON((1 1,0 0, -1 1, 1 1))"))) │
│                              geometry                              │
╞════════════════════════════════════════════════════════════════════╡
│ LINESTRING(1 1,0 0,-1 1,1 1)                                       │
└────────────────────────────────────────────────────────────────────┘