ST_SymDifference

Determine the geometry that corresponds to the non-intersecting parts of the specified geometries.

Syntax

ST_SymDifference(geo1, geo2);
geo1
The first input geometry.

Type: ST_GEOMETRY(ANY)

geo2
The second input geometry.

Type: ST_GEOMETRY(ANY)

Returns

A value of type ST_GEOMETRY(ANY) that contains a geometry that represents the non-intersecting parts of the input geometries.

Examples

SELECT inza..ST_ASTEXT(inza..ST_SYMDIFFERENCE(inza..ST_WKTToSQL('POLYGON ((0 0, 11 0, 11 11,
            0 11, 0 0))'), inza..ST_WKTToSQL('POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))')));
 
ST_ASTEXT
-----------
MULTIPOLYGON (((0 0, 11 0, 11 10.5, 10 10, 10 11, 0 11, 0 0)), ((10 11, 11 11, 11 10.5, 20 15, 20 20, 10 20, 10 11)))
(1 row)