Name

CG_Difference — Computes the geometric difference between two geometries

Synopsis

geometry CG_Difference( geometry 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]

NOTE: this function returns a geometry.

可用性:3.5.0

该方法需要SFCGAL后端。

此函数支持三角形和不规则三角网面 (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)