任何人都可以告诉我为什么{5}或多个多边形序列上的unary_union
会返回空的GeometryCollection
:
import numpy as np
from shapely.ops import unary_union
from shapely.geometry import Polygon
x = np.array([0, 0, 1, 1, 0], dtype=float)
y = np.array([0, 1, 1, 0, 0], dtype=float)
polygons = []
for i in range(5):
polygons.append(Polygon(list(zip(x, y))))
x += 1
un = unary_union(polygons)
而4个或更少的多边形按预期返回多边形?
polygons = []
for i in range(4):
polygons.append(Polygon(list(zip(x, y))))
x += 1
un2 = unary_union(polygons)