multipart geometry in intersect region (#1475)

pull/1559/head
Kaalleen 2022-01-23 08:36:07 +01:00 zatwierdzone przez GitHub
rodzic 9a48fff981
commit 3514f878ee
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -143,8 +143,8 @@ def intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing=Non
res = grating_line.intersection(shape)
if (isinstance(res, shapely.geometry.MultiLineString)):
runs = [line_string.coords for line_string in res.geoms]
if (isinstance(res, shapely.geometry.MultiLineString) or isinstance(res, shapely.geometry.GeometryCollection)):
runs = [line_string.coords for line_string in res.geoms if isinstance(line_string, shapely.geometry.LineString)]
else:
if res.is_empty or len(res.coords) == 1:
# ignore if we intersected at a single point or no points