Skip to main content
Returns the Nth (1-based) interior linestring ring of the polygon geometry. Returns NULL if the geometry is not a polygon or the given N is out of range ST_InteriorRingN
The index is 1-based: n = 1 returns the first interior ring; zero, negative, or out-of-range indices return NULL. When migrating from a runtime with zero-based indices, add 1 to the old index. See Geometry and raster API migration.

Signatures

Parameters

Geometry
required
The input geometry.
Integer
required
The 1-based index of the interior ring.

Return type

The resulting geometry.

Example