ST_Boundary — Restituisce il confine di una geometria.
geometry ST_Boundary(geometry  geomA);
Restituisce la chiusura del confine combinatorio di questa geometria. Il confine combinatorio è definito come descritto nella sezione 3.12.3.2 di OGC SPEC. Poiché il risultato di questa funzione è una chiusura, e quindi topologicamente chiusa, il confine risultante può essere rappresentato utilizzando le primitive della geometria rappresentativa descritte nella sezione 3.12.2 di OGC SPEC.
Eseguito dal modulo GEOS
                 
               | 
              |
| 
                 Prma della 2.0.0, questa funzione dava un'eccezione se usata con   | 
            
            
 Questo metodo implementa le OGC Simple Features Implementation Specification for SQL 1.1.  OGC SPEC s2.1.1.1
            
 Questo metodo implementa la specifica SQL/MM.  SQL-MM IEC 13249-3: 5.1.17
            
 Questa funzione supporta il 3d e non distrugge gli z-index. 
Miglioramento: nella versione 2.1.0 è stato introdotto il supporto per Triangle
Modificato: dalla versione 3.2.0 supporta TIN, non usa geos, non linearizza le curve
                   
                      Linestring con sovrapposizione dei punti di confine 
 SELECT ST_Boundary(geom)
FROM (SELECT 'LINESTRING(100 150,50 60, 70 80, 160 170)'::geometry As geom) As f;
                                
                  
 
ST_AsText output
MULTIPOINT((100 150),(160 170))
                  
  | 
                
                   
                      buchi di poligoni con confini multilinestring 
 SELECT ST_Boundary(geom)
FROM (SELECT
'POLYGON (( 10 130, 50 190, 110 190, 140 150, 150 80, 100 10, 20 40, 10 130 ),
        ( 70 40, 100 50, 120 80, 80 110, 50 90, 70 40 ))'::geometry As geom) As f;
                                
                  
 
ST_AsText output
MULTILINESTRING((10 130,50 190,110 190,140 150,150 80,100 10,20 40,10 130),
        (70 40,100 50,120 80,80 110,50 90,70 40))
                  
  | 
              
SELECT ST_AsText(ST_Boundary(ST_GeomFromText('LINESTRING(1 1,0 0, -1 1)')));
st_astext
-----------
MULTIPOINT((1 1),(-1 1))
SELECT ST_AsText(ST_Boundary(ST_GeomFromText('POLYGON((1 1,0 0, -1 1, 1 1))')));
st_astext
----------
LINESTRING(1 1,0 0,-1 1,1 1)
--Using a 3d polygon
SELECT ST_AsEWKT(ST_Boundary(ST_GeomFromEWKT('POLYGON((1 1 1,0 0 1, -1 1 1, 1 1 1))')));
st_asewkt
-----------------------------------
LINESTRING(1 1 1,0 0 1,-1 1 1,1 1 1)
--Using a 3d multilinestring
SELECT ST_AsEWKT(ST_Boundary(ST_GeomFromEWKT('MULTILINESTRING((1 1 1,0 0 0.5, -1 1 1),(1 1 0.5,0 0 0.5, -1 1 0.5, 1 1 0.5) )')));
st_asewkt
----------
MULTIPOINT((-1 1 1),(1 1 0.75))