Closed orrsim closed 9 months ago
Thanks @orrsim for opening this!
@AtelierLibre led the development of this functionality: do you have any preliminary insights or suggestions?
@orrsim for troubleshooting, can you provide the OSM ID of a specific polygon feature that has multiple holes but OSMnx only renders with 1 hole?
@gboeing some examples are: Thousand Island Lake (207450) Fjorda (175565)
Hello both, apologies that I wasn't able to look at this over the break, I should be able to put a bit of time against this now.
Closed by #1104
Contributing guidelines
Documentation
Existing issues
What operating system and Python version are you using?
Windows 11 Python 3.12
What OSMnx version are you using?
1.8.0
Environment packages and versions
How did you install OSMnx?
Pip
Problem description
Any polygon generated with holes is generated with a maximum of one hole.
I believe this issue is in line 895 of features.py
outer_polygon_diff = outer_polygon.difference(inner_polygon)
Outer_polygon_diff is reset to outer_polygon at the start of each iteration of the inner loop. This means that only the last subtraction will have an effect because each new subtraction is done on the original outer_polygon, not on the result of the previous subtraction.
outer_polygon_diff = outer_polygon_diff.difference(inner_polygon)
Complete minimal reproducible example