pygeoops.difference_all_tiled#
- pygeoops.difference_all_tiled(geometry: BaseGeometry, geometries_to_subtract, keep_geom_type: bool | int = False, subdivide_coords: int = 1000) BaseGeometry#
Subtracts all geometries in geometries_to_subtract from the input geometry.
If the input geometry has many points, it can be subdivided in smaller parts to potentially speed up processing as controlled by parameter subdivide_coords. This will result in extra collinear points being added to the boundaries of the output.
Notes
the geometries_to_subtract won’t be subdivided, so if they can contain complex geometries as well you can use subdivide on them first.
if geometries_to_subtract is None, the input geometry is returned.
best performance will be obtained if only geometries_to_subtract are passed in that intersect the input geometry.
- Parameters:
geometry (geometry) – single geometry to substract 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, you specify the primitive type to retain: 0: all, 1: points, 2: lines, 3: polygons. Defaults to False.
subdivide_coords (int) – if > 0, the input geometry will be subdivided to parts with about this number of points to potentially speedup processing. Subdividing can result in extra collinear points being added to the boundaries of the output. If <= 0, no subdividing is applied. Defaults to 1000.
- Returns:
the geometry with the geometries_to_subtract subtracted from it.
- Return type:
geometry