Shapely

Latest version: v2.0.7

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

3.12

- ``oriented_envelope`` / ``minimum_rotated_rectangle`` changed its implementation
in GEOS 3.12. Be aware that results will change when updating GEOS. Coincidentally
the implementation is similar to the shapely 1.x approach. (1885)
- ``get_coordinate_dimension`` / ``has_z`` now considers geometries three dimensional if
they have a NaN z coordinate. (1885)
- ``voronoi_polygons`` changed its output from a LINESTRING to a MULTILINESTRING in case
``only_edges=True``. (1885)
- The WKT representation of a MULTIPOINT changed from for example "MULTIPOINT (0 0, 1 1)"
to "MULTIPOINT ((0 0), (1 1))". (1885)

Deprecations:

- The ``shapely.geos`` module is deprecated. All GEOS-version related attributes are
available directly from the top-level ``shapely`` namespace as well (already since
shapely 2.0) (2145).
- The ``shapely.vectorized`` module is deprecated. The two functions (``contains and
``touches``) can be replaced by the top-level vectorized functions ``contains_xy``
and ``intersects_xy`` (1630).

Packaging:

- Require GEOS >= 3.9, NumPy >= 1.21, and Python >= 3.10 (1802, 1885, 2124)
- Binary wheels are now built for musllinux (Alpine) x86_64 platforms (1996).
- Upgraded the GEOS version in the binary wheel distributions to 3.13.1.

2.1.0

------------------

API changes:

- Equality of geometries (``geom1 == geom2``) now considers NaN coordinate
values in the same location to be equal (1775). It is recommended however to
ensure geometries don't have NaN values in the first place, for which you can
now use the ``handle_nan`` parameter in construction functions.

Bug fixes:

- Prevent crash when serializing a number > 1e100 to WKT with GEOS < 3.13. (1907)
- Ensure ``plot_polygon`` does not color the interiors of polygons (1933).
- Fixes GeoJSON serialization of empty points (2118)
- Fixes `__geo_interface__` handling of empty points (2120)
- Fixes ``GeometryCollection()`` constructor accepting an array of geometries (2017).

Improvements:

- Add a ``handle_nan`` parameter to ``shapely.points()``,
``shapely.linestrings()`` and ``shapely.linearrings()`` to allow, skip, or
error on nonfinite (NaN / Inf) coordinates. The default behaviour (allow) is
backwards compatible (1594, 1811).
- Add an ``interleaved`` parameter to ``shapely.transform()`` allowing a transposed call
signature in the ``transformation`` function.
- The ``include_z`` in ``shapely.transform()`` now also allows ``None``, which
lets it automatically detect the dimensionality of each input geometry.
- Add an ``include_m`` keyword in ``to_ragged_array`` and ``get_coordinates`` (2234, 2235)
- Add parameters ``method`` and ``keep_collapsed`` to ``shapely.make_valid()`` (1941)
- The ``voronoi_polygons`` now accepts the ``ordered`` keyword, optionally forcing the
order of polygons within the GeometryCollection to follow the order of input
coordinates. Requires at least GEOS 3.12. (1968)
- Add option on ``invalid="fix"`` to ``from_wkb`` and ``from_wkt`` (2094)
- Add a ``normalize`` keyword to ``equals_exact`` (1231)
- Handle ``Feature`` type in ``shapely.geometry.shape`` (1815)
- Add support to split polygons by multilinestrings (2206)
- Add an ``m`` attribute on the Point class and an ``has_m`` attribute on the base Geometry class.

New functions:

- Add ``disjoint_subset_union`` and ``disjoint_subset_union_all`` as an optimized
version of union and union_all, assuming inputs can be divided into subsets that do
not intersect. Requires at least GEOS 3.12.
- Add function ``minimum_clearance_line`` (2106)
- Add function ``maximum_inscribed_circle`` (1307)
- Add function ``orient_polygons`` (2147)
- Add function ``constrained_delaunay_triangles`` (1685)
- Add function ``coverage_simplify`` to allow topological simplification of polygonal
coverages (1969)
- Add function ``coverage_is_valid`` and ``coverage_invalid_edges`` to validate
an array of geometries as valid topological coverage (2156)
- Add function ``equals_identical`` (1760)
- Add function ``has_m`` (2008)
- Add function ``get_m`` (2019)

2.0.7

------------------

Bug fixes:

- Fix compilation error on certain Linux platforms, such as Alpine (1945).
- Fixes crash when reading nonlinear geometry types (CircularString,
CompoundCurve, MultiCurve, CurvePolygon, MultiSurface) from WKB/WKT with
GEOS >= 3.13; these types are not yet supported in Shapely and now raise a
``NotImplementedError`` (2160)
- Fix the ``project`` method to return a Python float (2093).

2.0.6

------------------

Bug fixes:

- Fix compatibility with NumPy 2.1.0 (2099).

Wheels are available for Python 3.13 (and still include GEOS 3.11.4).

2.0.5

------------------

Binary wheels on PyPI include GEOS 3.11.4 from 2024-06-05. Furthermore,
universal2 wheels are removed for macOS since both x86_64 and arm64 wheels are
provided.

Bug fixes:

- Fix Point x/y/z attributes to return Python floats (2074).
- Fix affinity for Apple silicon with NumPy 2.0 by reverting matmul, and
use direct matrix multiplication instead (2085).

2.0.4

------------------

Wheels for Python versions >= 3.9 will be compatible with the upcoming NumPy 2.0
release (as well as with supported NumPy 1.x versions).

Bug fixes:

- Fix bug in ``to_wkt`` with multiple empty Z geometries (2012).
- Fix bug in ``to_ragged_array`` for an array of Points with missing values (2034).

Page 1 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.