Changes
=======

2.0.7 (2025-01-30)
------------------

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 (2024-08-19)
------------------

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 (2024-07-13)
------------------

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 (2024-04-16)
------------------

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).

2.0.3 (2024-02-16)
------------------

- Fix regression in the ``oriented_envelope`` ufunc to accept array-like input
  in case of GEOS<3.12 (#1929).
- The binary wheels are not yet compatible with a future NumPy 2.0 release,
  therefore a ``numpy<2`` upper pin was added to the requirements (#1972).
- Upgraded the GEOS version in the binary wheel distributions to 3.11.3.

2.0.2 (2023-10-12)
------------------

Bug fixes:

- Fix regression in the (in)equality comparison (``geom1 == geom2``) using ``__eq__`` to
  not ignore the z-coordinates (#1732).
- Fix ``MultiPolygon()`` constructor to accept polygons without holes (#1850).
- Fix ``minimum_rotated_rectangle`` (``oriented_envelope``) to always return
  the minimum area solution (instead of minimum width). In practice, it will use the
  GEOS implementation only for GEOS 3.12+, and for older GEOS versions fall back to the
  implementation that was included in Shapely < 2.

Wheels are available for Python 3.12 (and still include GEOS 3.11.2). Building
from source is now compatible with Cython 3.

2.0.1 (2023-01-30)
------------------

Bug fixes:

- Fix regression in the ``Polygon()`` constructor taking a sequence of Points (#1662).
- Fix regression in the geometry constructors when passing ``decimal.Decimal``
  coordinate values (#1707).
- Fix ``STRtree()`` to not make the passed geometry array immutable as side-effect of
  the constructor (#1714).
- Fix the ``directed`` keyword in ``shapely.ops.linemerge()`` (#1695).

Improvements:

- Expose the function to get a matplotlib Patch object from a (Multi)Polygon (without
  already plotting it) publicly as :func:`shapely.plotting.patch_from_polygon` (#1704).

For a full changelog, see
https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-0-1

2.0.0 (2022-12-12)
------------------

Shapely version 2.0.0 is a major release featuring a complete refactor of the
internals and new vectorized (element-wise) array operations providing
considerable performance improvements. 

For a full changelog, see
https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-0-0


Relevant changes in behaviour compared to 2.0rc3:

- Added temporary support for unpickling shapely<2.0 geometries.

2.0rc1 (2022-11-26)
-------------------

Relevant changes in behaviour compared to 2.0b2:

- The ``Point(..)`` constructor no longer accepts a sequence of coordinates
  consisting of more than one coordinate pair (previously, subsequent
  coordinates were ignored) (#1600).
- Fix performance regression in the ``LineString()`` constructor when passing
  a numpy array of coordinates (#1602).

Wheels for 2.0rc1 published on PyPI include GEOS 3.11.1.

2.0b2 (2022-10-29)
------------------

Relevant changes in behaviour compared to 2.0b1:

- Fix for compatibility with PyPy (#1577).
- Fix to the ``Point()`` constructor to accept arrays of length 1 for the x and y
  coordinates (fix compatibility with Shapely 1.8).
- Raise ValueError for non-finite distance in the ``buffer()`` and ``offset_curve()``
  methods on the Geometry classes (consistent with Shapely 1.8).

2.0b1 (2022-10-17)
------------------

Relevant changes in behaviour compared to 2.0a1:

- Renamed the ``tolerance`` keyword to ``max_segment_length`` in the
  ``segmentize`` function.
- Renamed the ``quadsegs`` keyword in the top-level ``buffer`` and
  ``offset_curve`` functions and the ``resolution`` keyword in the Geometry
  class ``buffer`` and ``offset_curve`` methods all to ``quad_segs``.
- Added use of ``GEOSGeom_getExtent`` to speed up bounds calculations for
  GEOS >= 3.11.
- Restored the behaviour of ``unary_union`` to return an empty GeometryCollection
  for an empty or all-None sequence as input (and the same for ``intersection_all``
  and ``symmetric_difference_all``).
- Fixed the Geometry objects to be weakref-able again (#1535).
- The ``.type`` attribute is deprecated, use ``.geom_type`` instead (which
  already existed before as well) (#1492).

Wheels for 2.0b1 published on PyPI include GEOS 3.11.0.

2.0a1 (2022-08-03)
------------------

Shapely version 2.0 alpha 1 is the first of a major release featuring a
complete refactor of the internals and new vectorized (element-wise) array
operations providing considerable performance improvements. For a full
changelog, see https://shapely.readthedocs.io/en/latest/release/2.x.html#version-2-0-0

Wheels for 2.0a1 published on PyPI include GEOS 3.10.3.

1.8.5.post1 (2022-10-13)
------------------------

Packaging:

Wheels are provided for Python versions 3.6-3.11 and Cython 0.29.32 is used to
generate C extension module code.

1.8.5 (2022-10-12)
------------------

Packaging:

Python 3.11 wheels have been added to the matrix for all platforms.

Bug fixes:

- Assign _lgeos in the macos frozen app check, fixing a bug introduced in 1.8.2
  (#1528).
- An exception is now raised when nan is passed to buffer and parallel_offset,
  preventing segmentation faults (#1516).

1.8.4 (2022-08-17)
------------------

Bug fixes:

- The new c_geom_p type caused a regression and has been removed (#1487).

1.8.3 (2022-08-16)
------------------

Deprecations:

The STRtree class will be changed in 2.0.0 and will not be compatible with the
class in versions 1.8.x. This change obsoletes the deprecation announcement in
1.8a3 (below).

Packaging:

Wheels for 1.8.3 published on PyPI include GEOS 3.10.3.

Bug fixes:

- The signature for GEOSMinimumClearance has been corrected, fixing an issue
  affecting aarch64-darwin (#1480)
- Return and arg types have been corrected and made more strict for area,
  length, and distance properties.
- A new c_geom_p type has been created to replace c_void_p when calling GEOS
  functions (#1479).
- An incorrect polygon-line intersection (#1427) has been fixed in GEOS 3.10.3,
  which will be included in wheels published to PyPI.
- GEOS buffer parameters are now destroyed, fixing a memory leak (#1440).

1.8.2 (2022-05-03)
------------------

- Make Polygons and MultiPolygons closed by definition, like LinearRings.
  Resolves #1246.
- Perform frozen app check for GEOS before conda env check on macos as we
  already do on linux (#1301).
- Fix leak of GEOS coordinate sequence in nearest_points reported in #1098.

1.8.1.post1 (2022-02-17)
------------------------

This post-release addresses a defect in the 1.8.1 source distribution. No .c
files are included in the 1.8.1.post1 sdist and Cython is required to build and
install from source.

1.8.1 (2022-02-16)
------------------

Packaging:

Wheels for 1.8.1 published on PyPI include GEOS 3.10.2. This version is the
best version of GEOS yet. Discrepancies in behavior compared to previous
versions are considered to be improvements.

For the first time, we will publish wheels for macos_arm64 (see PR #1310).

Python version support:

Shapely 1.8.1 works with Pythons 3.6-3.10.

Bug fixes:

- Require Cython >= 0.29.24 to support Python 3.10 (#1224).
- Fix array_interface_base (#1235).

1.8.0 (2021-10-25)
------------------

This is the final 1.8.0 release. There have been no changes since 1.8rc2.

1.8rc2 (2021-10-19)
-------------------

Build:

A pyproject.toml file has been added to specify build dependencies for the
_vectorized and _speedups modules (#1128). To install shapely without these
build dependencies, use the features of your build tool that disable PEP 517
and 518 support.

Bug fixes:

- Part of PR #1042, which added a new primary GEOS library name to be searched
  for, has been reverted by PR #1201.

1.8rc1 (2021-10-04)
-------------------

Deprecations:

The almost_exact() method of BaseGeometry has been deprecated. It is confusing
and will be removed in 2.0.0. The equals_exact() method is to be used instead.

Bug fixes:

- We ensure that the _speedups module is always imported before _vectorized to
  avoid an unexplained condition on Windows with Python 3.8 and 3.9 (#1184).

1.8a3 (2021-08-24)
------------------

Deprecations:

The STRtree class deprecation warnings have been removed. The class in 2.0.0
will be backwards compatible with the class in 1.8.0.

Bug fixes:

- The __array_interface__ raises only AttributeError, all other exceptions are
  deprecated starting with Numpy 1.21 (#1173).
- The STRtree class now uses a pair of item, geom sequences internally instead
  of a dict (#1177).


1.8a2 (2021-07-15)
------------------

Python version support:

Shapely 1.8 will support only Python versions >= 3.6.

New features:

- The STRtree nearest*() methods now take an optional argument that
  specifies exclusion of the input geometry from results (#1115).
- A GeometryTypeError has been added to shapely.errors and is consistently
  raised instead of TypeError or ValueError as in version 1.7. For backwards
  compatibility, the new exception will derive from TypeError and Value error
  until version 2.0 (#1099).
- The STRtree class constructor now takes an optional second argument, a
  sequence of objects to be stored in the tree. If not provided, the sequence
  indices of the geometries will be stored, as before (#1112).
- The STRtree class has new query_geoms(), query_items(), nearest_geom(), and
  nearest_item() methods (#1112). The query() and nearest() methods remain as
  aliases for query_geoms() and nearest_geom().

Bug fixes:

- We no longer attempt to load libc to get the free function on Linux, but get
  it from the global symbol table.
- GEOS error messages printed when GEOS_getCoordSeq() is passed an empty
  geometry are avoided by never passing an empty geometry (#1134).
- Python's builtin super() is now used only as described in PEP 3135 (#1109).
- Only load conda GEOS dll if it exists (on Windows) (#1108).
- Add /opt/homebrew/lib to the list of directories to be searched for the GEOS
  shared library.
- Added new library search path to assist app creation with cx_Freeze.

1.8a1 (2021-03-03)
------------------

Shapely 1.8.0 will be a transitional version. There are a few bug fixes and new
features, but it is mainly about warning of the upcoming changes in 2.0.0.
Several more pre-releases before 1.8.0 are expected. See the migration guide
to Shapely 1.8 / 2.0 for more details on how to update your code
(https://shapely.readthedocs.io/en/latest/migration.html).

Python version support:

Shapely 1.8 will support only Python versions >= 3.5 (#884).

Deprecations:

The following functions and geometry attributes and methods will be removed in
version 2.0.0.

- ops.cascaded_union
- geometry .empty()
- geometry .ctypes and .__array_interface__
- multi-part geometry .__len__
- setting custom attributes on geometry objects

Geometry objects will become immutable in version 2.0.0.

The STRtree class will be entirely changed in 2.0.0. The exact future API is
not yet decided, but will be decided before 1.8.0 is released.

Deprecation warnings will be emitted in 1.8a1 when any of these features are
used.

The deprecated .to_wkb() and .to_wkt() methods on the geometry objects have
been removed.

New features:

- Add a normalize() method to geometry classes, exposing the GEOSNormalize
  algorithm (#1090).
- Initialize STRtree with a capacity of 10 items per node (#1070).
- Load libraries relocated to shapely/.libs by auditwheel versions < 3.1 or
  relocated to Shapely.libs by auditwheel versions >= 3.1.
- shapely.ops.voronoi_diagram() computes the Voronoi Diagram of a geometry or
  geometry collection (#833, #851).
- shapely.validation.make_valid() fixes invalid geometries (#883)

Bug fixes:

- For pyinstaller we now handle the case of more than one GEOS library in the
  environment, such as when fiona and rasterio wheels are co-installed with
  shapely (#1071).
- The ops.split function now splits on touch to eliminate confusing
  discrepancies between results using multi and single part splitters (#1034).
- Several issues with duplication and order of vertices in ops.substring have
  been fixed (#1008).

Packaging:

- The wheels uploaded to PyPI will include GEOS 3.9.1.

Previous releases
-----------------

For older releases in the 1.x line, see https://shapely.readthedocs.io/en/latest/release/1.x.html
