-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shapely v1.8 deprecation warnings in advance of Shapely 2.0 release #764
Comments
What versions of OSMnx and Shapely are you using? |
I've got: |
Thanks. Can you provide a reproducible code snippet? |
I you want I can try to make a PR that will fix this later |
I have the same issue (using OSMnx 1.1.1):
More info in this PR, were the deprecation warnings is added: shapely/shapely#950. Shapely 1.8.0 was released a few days ago, which was the first stable release to include the warnings. |
Yes. This is a known issue we'll have to address in the coming weeks (see also shapely/shapely#932) as Shapely begins its deprecation warnings in advance of its v2.0 overhaul (see shapely/shapely#962 and shapely/shapely-rfc#1). PRs are welcome if anyone spots a deprecation with a straightforward resolution! |
We probably should also constrain the requirements file to keep Shapely >=1.8 and <2.0 at this point, to keep users from installing 2.0 in their OSMnx environment before we confirm everything is compatible on our end. |
These were the locations I found the warnings so far:
|
Quickly checking those listed occurences, they should be straightforward to fix I think. For example, the case of elif merged_outer_linestrings.geom_type == "MultiLineString":
for merged_outer_linestring in list(merged_outer_linestrings):
... can be changed to elif merged_outer_linestrings.geom_type == "MultiLineString":
for merged_outer_linestring in merged_outer_linestrings.geoms:
... (so adding a See https://shapely.readthedocs.io/en/stable/migration.html#multi-part-geometries-will-no-longer-be-sequences-length-iterable-indexable for more details.
The |
Thanks @jorisvandenbossche! |
Proposed fix in #773 |
Resolved by #773 |
Hello, may I ask where this code was modified? I did not find the source file |
In #773 |
What is the fix in #773 ? I do not see any solution |
Is your feature proposal related to a problem?
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.Describe the solution you'd like to propose
Updating osmnx to use the
geoms
propertyThe text was updated successfully, but these errors were encountered: