The ST_Difference method finds the spatial difference of two geometries.
A point is included in the result if it is present in the geometry-expression but not
present in geo2.
Unlike other spatial set operations (ST_Union, ST_Intersection, ST_SymDifference), the ST_Difference()
method is not symmetric: the method can give a different answer for
A.ST_Difference( B )
B.ST_Difference( A ).
If the geometry-expression contains circular strings, then these are interpolated to line strings.
The following example shows the difference (C) of a square (A) with a circle (B) removed
and the difference (D) of a circle (B) with a square (A) removed.
SELECT NEW ST_Polygon( 'Polygon( (-1 -0.25, 1 -0.25, 1 2.25, -1 2.25, -1 -0.25) )' ) AS A
, NEW ST_CurvePolygon( 'CurvePolygon( CircularString( 0 1, 1 2, 2 1, 1 0, 0 1 ) )' ) AS B
, A.ST_Difference( B ) AS C
, B.ST_Difference( A ) AS D
The following picture shows the difference C=A-B and D=B-A as the shaded portion of the picture.
Each difference is a single surface that contains all of the points that are in the geometry
on the left hand side of the difference and not in the geometry on the right hand side.