ST_InteriorRingN
Determine the nth interior ring of a polygon geometry.
Syntax
ST_InteriorRingN(geo, n);
- geo
- The input geometry.
Type: ST_GEOMETRY(ANY)
- n
- The index, starting with 1, that identifies the interior ring.
Type: INT4
Returns
A value of type ST_GEOMETRY(ANY) that contains a line geometry, or NULL if there is no nth interior ring.
Examples
inza..ST_AsText(inza..ST_InteriorRingN(inza..ST_WKTToSQL('POLYGON ((0 0, 100 0, 100
100, 0 100, 0 0), (10 10, 10 20, 20 20, 20 15, 10 10))'), 1));
ST_ASTEXT
---------
LINESTRING (10 10, 10 20, 20 20, 20 15, 10 10)
(1 row)
SELECT inza..ST_InteriorRingN(inza..ST_WKTToSQL('Polygon ((10 10, 10 20, 20 20, 20 15,
10 10))'), 5);
ST_INTERIORRINGN
----------------
(1 row)