Name

CG_Difference — Computes the geometric difference between two geometries

Synopsis

geometry CG_Difference( geometry geomA , geometry geomB );

Description

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]

NOTE: this function returns a geometry.

Disponibilité : 3.5.0

Cette méthode nécessite le backend SFCGAL.

Cette fonction prend en charge les triangles et les réseaux irréguliers triangulés (TIN).

Exemples de géométrie

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)