fixing https://github.com/qurator-spk/eynollah/issues/169 : This fix actually resolves the error. Additionally, the contour with intersections no longer appears in the results.#221
Conversation
…r. Additionally, the contour with intersections no longer appears in the results.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #221 +/- ##
==========================================
- Coverage 58.45% 58.36% -0.09%
==========================================
Files 12 12
Lines 1372 1374 +2
Branches 323 325 +2
==========================================
Hits 802 802
- Misses 434 435 +1
- Partials 136 137 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bertsky
left a comment
There was a problem hiding this comment.
I can see how this would help – as a workaround.
But really, this is not the way to fix this. The code above in particular tries to avoid yielding multiple geometries – by finding the best path through all parts and connecting them with little "bridges". So if that failed, for some reason, we must fix that directly.
Could you please provide me with the input polygons that caused this?
| jointp = unary_union(polygons) | ||
|
|
||
| if isinstance(jointp, MultiPolygon): | ||
| jointp = max(jointp.geoms, key=lambda p: p.area) # Choose the largest polygon |
There was a problem hiding this comment.
One simple way to share example polygon data is by using Shapely's wkt serialization, which can easily be printed, plotted, re-imported etc. So here, e.g. if you do...
| jointp = max(jointp.geoms, key=lambda p: p.area) # Choose the largest polygon | |
| for geom in jointp.geoms: | |
| print(geom.wkt) | |
| jointp = max(jointp.geoms, key=lambda p: p.area) # Choose the largest polygon |
...and then send me the stdout, that would really help.
For discussion: @vahidrezanezhad has a workaround for the multipolygon issue where eynollah produces polygons with self-intersections.