Nome

ST_NRings — Returns the number of rings in a polygonal geometry.

Sinossi

integer ST_NRings(geometry geomA);

Descrizione

If the geometry is a polygon or multi-polygon returns the number of rings. Unlike NumInteriorRings, it counts the outer rings as well.

Questa funzione supporta il 3d e non distrugge gli z-index.

Questo metodo supporta le Curve e le Circular String.

Esempi

Code
SELECT ST_NRings(geom) As Nrings, ST_NumInteriorRings(geom) As ninterrings
FROM (SELECT 'POLYGON((1 2,3 4,5 6,1 2))'::geometry As geom) As foo;
Output
nrings | ninterrings
--------+-------------
      1 |           0
(1 row)
Figure
Geometry figure for visual-st-nrings-01

Si veda anche

ST_NumInteriorRings