Name

ST_IsRing — Teste si une ligne est fermée et simple.

Synopsis

boolean ST_IsRing(geometry g);

Description

Renvoie TRUE si cette LINESTRING est à la fois ST_IsClosed (ST_StartPoint(g) ~= ST_Endpoint(g)) et ST_IsSimple (pas d'auto intersection).

Cette méthode implémente la spécification OGC Simple Features Implementation Specification for SQL 1.1.

2.1.5.1

Cette méthode implémente la spécification SQL/MM.

SQL-MM 3 : 7.1.6

[Note]

La norme SQL-MM stipule que ST_IsRing(NULL) doit renvoyer 0. PostGIS renvoie NULL.

Exemples

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;
 st_isring | st_isclosed | st_issimple
-----------+-------------+-------------
 t         | t           | t
(1 row)

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;
 st_isring | st_isclosed | st_issimple
-----------+-------------+-------------
 f         | t           | f
(1 row)

Voir aussi

ST_IsClosed, ST_IsSimple, ST_StartPoint, ST_EndPoint