shapely.symmetric_difference_all#
- symmetric_difference_all(geometries, axis=None, **kwargs)#
Return the symmetric difference of multiple geometries.
This function ignores None values when other Geometry elements are present. If all elements of the given axis are None an empty GeometryCollection is returned.
Deprecated since version 2.1.0: This function behaves incorrectly and will be removed in a future version. See shapely/shapely#2027 for more details.
- Parameters:
- geometriesarray_like
Geometries to calculate the combined symmetric difference of.
- axisint, optional
Axis along which the operation is performed. The default (None) performs the operation over all axes, returning a scalar value. Axis may be negative, in which case it counts from the last to the first axis.
- **kwargs
See NumPy ufunc docs for other keyword arguments.
See also
Notes
Deprecated since version 2.1.0: A deprecation warning is shown if
axis
is specified as a positional argument. This will need to be specified as a keyword argument in a future release.Examples
>>> import shapely >>> from shapely import LineString >>> line1 = LineString([(0, 0), (2, 2)]) >>> line2 = LineString([(1, 1), (3, 3)]) >>> shapely.symmetric_difference_all([line1, line2]) <MULTILINESTRING ((0 0, 1 1), (2 2, 3 3))> >>> shapely.symmetric_difference_all([[line1, line2, None]], axis=1).tolist() [<MULTILINESTRING ((0 0, 1 1), (2 2, 3 3))>] >>> shapely.symmetric_difference_all([line1, None]) <LINESTRING (0 0, 2 2)> >>> shapely.symmetric_difference_all([None, None]) <GEOMETRYCOLLECTION EMPTY>