Open larsschwarz opened 1 year ago
Using pip3 install -U "shapely<2"
with an example the following errors pop up:
lib/python3.11/site-packages/shapely/ops.py:42: ShapelyDeprecationWarning: Iteration over multi-part geometries is deprecated and will be removed in Shapely 2.0. Use the `geoms` property to access the constituent parts of a multi-part geometry.
source = iter(source)
lib/python3.11/site-packages/alphashape/optimizealpha.py:41: ShapelyDeprecationWarning: Iteration over multi-part geometries is deprecated and will be removed in Shapely 2.0. Use the `geoms` property to access the constituent parts of a multi-part geometry.
return all([polygon.intersects(point) for point in points])
lib/python3.11/site-packages/descartes/patch.py:62: ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
vertices = concatenate([
So it seems like maybe iterating over geoms or coords is needed depending on the type.
I'm having the same issue with this too. The problem is exactly what is stated, which is that in the new version of Shapely, the MultiPoint object is no longer iterable which breaks a lot of alphashape functionality. This post confirms it
This is mostly for the developers on this side to handle. It involves re-writing both alphashape and optimizealpha
This looks like a duplicate of #37. As noted there, it has already been fixed on the master branch in #36. Unfortunately it just has not made it into a release yet. So for now you may want to install the version from the master branch with pip install git+https://github.com/bellockk/alphashape.git
instead.
Running alphashape 1.3.1 with Shapely 2.x returns
TypeError: 'MultiPoint' object is not iterable
error. This could be fixed by using the.geoms
attribute inoptimizealpha.py
, however it returns aZeroDivisionError: float division by zero
inalphashape.py
Does anyone have a fix for running it with Shapely 2?