mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-10-21 13:54:16 +02:00
join_polygons: try to catch rare case of MultiPolygon
This commit is contained in:
parent
f485dd4181
commit
2ac01ecacc
1 changed files with 2 additions and 0 deletions
|
@ -353,6 +353,8 @@ def join_polygons(polygons: Sequence[Polygon], scale=20) -> Polygon:
|
|||
bridgep = orient(LineString(nearest).buffer(max(1, scale/5), resolution=1), -1)
|
||||
polygons.append(bridgep)
|
||||
jointp = unary_union(polygons)
|
||||
if jointp.geom_type == 'MultiPolygon':
|
||||
jointp = unary_union(jointp.geoms)
|
||||
assert jointp.geom_type == 'Polygon', jointp.wkt
|
||||
# follow-up calculations will necessarily be integer;
|
||||
# so anticipate rounding here and then ensure validity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue