Skip to content

Commit

Permalink
DOC: switch cascaded_union and unary_union (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored and sgillies committed Jan 17, 2019
1 parent 5e4561c commit 524f26f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ boundaries.
.. note::

:meth:`union` is an expensive way to find the cumulative union
of many objects. See :func:`shapely.ops.cascaded_union` for a more effective
of many objects. See :func:`shapely.ops.unary_union` for a more effective
method.

Constructive Methods
Expand Down Expand Up @@ -2072,20 +2072,20 @@ using functions in the :mod:`shapely.ops` module.
Cascading Unions
----------------

The :func:`~shapely.ops.cascaded_union` function in `shapely.ops` is more
The :func:`~shapely.ops.unary_union` function in `shapely.ops` is more
efficient than accumulating with :meth:`union`.

.. plot:: code/cascaded_union.py

.. function:: shapely.ops.cascaded_union(geoms)
.. function:: shapely.ops.unary_union(geoms)

Returns a representation of the union of the given geometric objects.

.. code-block:: pycon
>>> from shapely.ops import cascaded_union
>>> from shapely.ops import unary_union
>>> polygons = [Point(i, 0).buffer(0.7) for i in range(5)]
>>> cascaded_union(polygons)
>>> unary_union(polygons)
<shapely.geometry.polygon.Polygon object at 0x...>
The function is particularly useful in dissolving `MultiPolygons`.
Expand All @@ -2095,20 +2095,20 @@ efficient than accumulating with :meth:`union`.
>>> m = MultiPolygon(polygons)
>>> m.area
7.6845438018375516
>>> cascaded_union(m).area
>>> unary_union(m).area
6.6103013551167971
.. function:: shapely.ops.cascaded_union(geoms)

Returns a representation of the union of the given geometric objects.

.. note::

In 1.2.16 :func:`shapely.ops.cascaded_union` is superceded by
Since 1.2.16 :func:`shapely.ops.cascaded_union` is superceded by
:func:`shapely.ops.unary_union` if GEOS 3.2+ is used. The unary union
function can operate on different geometry types, not only polygons as is
the case for the older cascaded unions.

.. function:: shapely.ops.unary_union(geoms)

Returns a representation of the union of the given geometric objects.

Delaunay triangulation
----------------------

Expand Down

0 comments on commit 524f26f

Please sign in to comment.