Name

ST_IsRing — Testar om en LineString är sluten och enkel.

Synopsis

boolean ST_IsRing(geometry g);

Beskrivning

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

Denna metod implementerar OGC:s implementeringsspecifikation för enkla funktioner för SQL 1.1. 2.1.5.1

Denna metod implementerar SQL/MM-specifikationen. SQL-MM 3: 7.1.6

[Note]

SQL-MM definierar att resultatet av ST_IsRing(NULL ) ska vara 0, medan PostGIS returnerar NULL.

Exempel

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)