CG_Difference — Computes the geometric difference between two geometries

`geometry `

geometry **CG_Difference**(`geomA` , geometry `geomB` `)`

;

Computes the geometric difference between two geometries. The resulting geometry is a set of points that are present in geomA but not in geomB.

Performed by the SFCGAL module

NOTE: this function returns a geometry. |

Availability: 3.5.0

This method needs SFCGAL backend.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

SELECT ST_AsText(CG_Difference('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::geometry, 'LINESTRING(0 0, 2 2)'::geometry)); cg_difference --------------- POLYGON((0 0,1 0,1 1,0 1,0 0)) (1 row)