pygeoops.difference_all#

pygeoops.difference_all(geometry: BaseGeometry, geometries_to_subtract, keep_geom_type: bool | int = False, check_intersects: bool = False) BaseGeometry#

Subtracts all geometries in geometries_to_subtract from the input geometry.

Parameters:
  • geometry (geometry) – single geometry to subtract geometries from.

  • geometries_to_subtract (geometry or arraylike) – geometries to substract.

  • keep_geom_type (Union[bool, int], optional) – True to retain only geometries in the output of the primitivetype of the input. If int, specify the geometry primitive type to retain: 0: all, 1: points, 2: lines, 3: polygons. Defaults to False.

  • check_intersects (bool, optional) – True to first check if the geometries_to_subtract intersect geometry. This will be faster if some geometries_to_subtract don’t intersect. Defaults to False.

Returns:

the geometry with the geometries_to_subtract subtracted from it.

Return type:

geometry