Skip to content
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

CV: TypeError: 'MultiLineString' object is not iterable #1657

Closed
davemfish opened this issue Oct 21, 2024 · 0 comments · Fixed by #1658
Closed

CV: TypeError: 'MultiLineString' object is not iterable #1657

davemfish opened this issue Oct 21, 2024 · 0 comments · Fixed by #1658
Assignees
Labels
bug Something isn't working
Milestone

Comments

@davemfish
Copy link
Contributor

This is a somewhat rare edge case that comes up with complicated landmasses & AOIs. It's hard enough to contrive an example that we don't test for it, apparently. Our code to handle MultLineString iteration simply is not compatible with Shapely 2.0. https://shapely.readthedocs.io/en/stable/migration.html#multi-part-geometries-will-no-longer-be-sequences-length-iterable-indexable

I have some user's data so I can reproduce and fix it.

Traceback (most recent call last):
  File "taskgraph\Task.py", line 674, in add_task
  File "taskgraph\Task.py", line 1093, in _call
  File "natcap\invest\coastal_vulnerability.py", line 1176, in prepare_landmass_line_index_and_interpolate_shore_points
TypeError: 'MultiLineString' object is not iterable
10/21/2024 17:29:44  natcap.invest.utils ERROR    Exception while executing natcap.invest.coastal_vulnerability
Traceback (most recent call last):
  File "natcap\invest\utils.py", line 165, in prepare_workspace
  File "invest\cli.py", line 470, in main
  File "natcap\invest\coastal_vulnerability.py", line 856, in execute
  File "taskgraph\Task.py", line 674, in add_task
  File "taskgraph\Task.py", line 1093, in _call
  File "natcap\invest\coastal_vulnerability.py", line 1176, in prepare_landmass_line_index_and_interpolate_shore_points
TypeError: 'MultiLineString' object is not iterable
@davemfish davemfish added the bug Something isn't working label Oct 21, 2024
@davemfish davemfish added this to the 3.14.3 milestone Oct 21, 2024
@davemfish davemfish self-assigned this Oct 21, 2024
davemfish added a commit to davemfish/invest that referenced this issue Oct 22, 2024
davemfish added a commit to davemfish/invest that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant