Returns the Nth interior ring of a polygon as a LineString. Interior ring indexes start at 1.
Syntax
geometry ST_InteriorRingN(geometry aPolygon, integer n)Parameters
| Parameter | Description |
|---|---|
aPolygon | The polygon geometry to query. |
n | The 1-based index of the interior ring to return. |
Usage notes
Returns NULL if
aPolygonis not a polygon, or ifnis invalid.Does not support MultiPolygon geometries. To process a MultiPolygon, use
ST_Dumpto decompose it into individual polygons first.Supports 3D geometries and preserves z coordinates.
Examples
SELECT ST_AsText(ST_InteriorRingN('POLYGON((1 0,3 0,0 3,1 0),(1 0,2 0, 0 2,1 0))'::geometry, 1));Output:
st_astext
-----------------------------
LINESTRING(1 0,2 0,0 2,1 0)
(1 row)该文章对您有帮助吗?