ST_InteriorRingN()¶
TL;DR¶
Use ST_InteriorRingN() to retrieve a one-based interior ring from a polygon.
Returns the interior ring at a one-based position in a polygon.
Syntax¶
ST_InteriorRingN(geom, n)
Arguments¶
Argument |
Description |
|---|---|
|
A |
|
The one-based interior-ring position ( |
Return Value¶
Returns the same geometry precision type as geom.
Usage Notes¶
Examples¶
DROP DATABASE IF EXISTS geo_accessor_demo;
CREATE DATABASE geo_accessor_demo;
USE geo_accessor_demo;
SELECT ST_AsText(ST_InteriorRingN(ST_GeomFromText('POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,4 2,4 4,2 4,2 2))'), 1)) AS interior_ring;
DROP DATABASE geo_accessor_demo;