ST_Difference

Detemine which points in the first specified geometry are not in the second geometry.

Syntax

ST_Difference(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 representing the points in the first geometry that are not in the second geometry.

Examples

inza..ST_AsText(inza..ST_Difference(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
---------
POLYGON ((0 0, 11 0, 11 10.5, 10 10, 10 11, 0 11, 0 0))
(1 row)