This topic describes the ST_ExteriorRing function. This function returns a LineString object that represents the exterior ring of the input polygon object.

Syntax

geometry  ST_ExteriorRing(geometry  aPolygon);

Parameters

Parameter Description
aPolygon The polygon object that you want to specify.

Description

  • If you do not specify a polygon object, this function returns NULL.
  • This function supports 3D objects and does not delete z coordinates.

Examples

SELECT ST_AsText(ST_ExteriorRing('POLYGON((1 0,3 0,0 3,1 0),(1 0,2 0, 0 2,1 0))'::geometry ));
          st_astext
-----------------------------
 LINESTRING(1 0,3 0,0 3,1 0)
(1 row)