Nome

ST_IsRing — Tests if a LineString is closed and simple.

Sinossi

boolean ST_IsRing(geometry g);

Descrizione

Returns TRUE if this LINESTRING is both ST_IsClosed (ST_StartPoint(g) ~= ST_EndPoint(g)) and ST_IsSimple (does not self intersect).

Questo metodo implementa le OGC Simple Features Implementation Specification for SQL 1.1. 2.1.5.1

Questo metodo implementa la specifica SQL/MM. SQL-MM 3: 7.1.6

[Nota]

SQL-MM defines the result of ST_IsRing(NULL) to be 0, while PostGIS returns NULL.

Esempi

Code
SELECT ST_IsRing(geom), ST_IsClosed(geom), ST_IsSimple(geom)
FROM (SELECT 'LINESTRING(0 0,0 1,1 1,1 0,0 0)'::geometry AS geom) AS foo;
Output
st_isring | st_isclosed | st_issimple
-----------+-------------+-------------
 t         | t           | t
(1 row)
Figure
Geometry figure for visual-st-isring-01
Code
SELECT ST_IsRing(geom), ST_IsClosed(geom), ST_IsSimple(geom)
FROM (SELECT 'LINESTRING(0 0,0 1,1 0,1 1,0 0)'::geometry AS geom) AS foo;
Output
st_isring | st_isclosed | st_issimple
-----------+-------------+-------------
 f         | t           | f
(1 row)
Figure
Geometry figure for visual-st-isring-02