Name

ST_InteriorRingN — Return the Nth interior linestring ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range.

Synopsis

geometry ST_InteriorRingN(geometry a_polygon, integer n);

Description

Return the Nth interior linestring ring of the polygon geometry. Return NULL if the geometry is not a polygon or the given N is out of range. index starts at 1.

[Note]

This will not work for MULTIPOLYGONs. Use in conjunction with ST_Dump for MULTIPOLYGONS

This method implements the OpenGIS Simple Features Implementation Specification for SQL 1.1.

This method implements the SQL/MM specification. SQL-MM 3: 8.2.6, 8.3.5

This function supports 3d and will not drop the z-index.

Examples

SELECT ST_AsText(ST_InteriorRingN(the_geom, 1)) As the_geom
FROM (SELECT ST_BuildArea(
		ST_Collect(ST_Buffer(ST_Point(1,2), 20,3),
			ST_Buffer(ST_Point(1, 2), 10,3))) As the_geom
		)  as foo
		

See Also

ST_ExteriorRing ST_BuildArea, ST_Collect, ST_Dump, ST_NumInteriorRing, ST_NumInteriorRings