Nome

ST_IsClosed — Restituisce TRUE se il punto iniziale e quello finale di LINESTRING coincidono. Per le superfici poliedriche indica una superficie chiusa (volumetrica).

Sinossi

boolean ST_IsClosed(geometry g);

Descrizione

Restituisce TRUE se il punto iniziale e quello finale di LINESTRING coincidono. Per le superfici poliedriche indicase la superficie è un'area (aperta) o un volume (chiusa).

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

Questo metodo implementa la specifica SQL/MM. SQL-MM 3: 7.1.5, 9.3.3

[Nota]

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

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

Questo metodo supporta le Curve e le Circular String.

Miglioramento: nella versione 2.0.0 è stato introdotto il supporto per le superfici poliedriche.

Questa funzione supporta le Polyhedral Surface.

Esempi con Stringhe di linee e punti

Code
SELECT ST_IsClosed('LINESTRING(0 0,1 1)'::geometry);
Output
f
Figure
Geometry figure for visual-st-isclosed-01
Code
SELECT ST_IsClosed('LINESTRING(0 0,0 1,1 1,0 0)'::geometry);
Output
t
Figure
Geometry figure for visual-st-isclosed-02
Code
SELECT ST_IsClosed('MULTILINESTRING((0 0,0 1,1 1,0 0),(0 0,1 1))'::geometry);
Output
f
Figure
Geometry figure for visual-st-isclosed-03
Code
SELECT ST_IsClosed('POINT(0 0)'::geometry);
Output
t
Code
SELECT ST_IsClosed('MULTIPOINT((0 0),(1 1))'::geometry);
Output
t

Esempi con superfici poliedriche

This example uses a cube.

Code
SELECT ST_IsClosed('POLYHEDRALSURFACE( ((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),
((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),
((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),
((0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)),((0 0 1,1 0 1,1 1 1,0 1 1,0 0 1)) )');
Output
t
Figure
Geometry figure for visual-st-isclosed-06

This example uses the same cube with one side missing.

Code
SELECT ST_IsClosed('POLYHEDRALSURFACE( ((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),
       ((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),
       ((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),
       ((0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)) )');
Output
f
Figure
Geometry figure for visual-st-isclosed-07

Si veda anche

ST_IsRing