Skip to content

Commit

Permalink
Fix shapely deprecation warnings (in preparation for upgrade to Shape…
Browse files Browse the repository at this point in the history
…ly 2) (#1647)
  • Loading branch information
jwkaltz authored Jan 4, 2023
1 parent ff46223 commit 780e2f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pyramid_oereb/core/records/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import logging
from datetime import datetime

from shapely.ops import linemerge, cascaded_union
from shapely.ops import linemerge, unary_union

from shapely.geometry import Point, MultiPoint, LineString, Polygon, GeometryCollection, MultiLineString, \
MultiPolygon
from shapely.ops import unary_union

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -113,7 +112,7 @@ def _extract_collection(self, result):
"""
if isinstance(result, GeometryCollection):
matching_geometries = list()
for part in result:
for part in result.geoms:
if self.geom_dim(part) == self.dim:
matching_geometries.append(part)
if self.dim == 0:
Expand All @@ -127,7 +126,7 @@ def _extract_collection(self, result):
elif self.dim == 1:
return linemerge(matching_geometries)
elif self.dim == 2:
return cascaded_union(matching_geometries)
return unary_union(matching_geometries)
else:
return result

Expand Down

0 comments on commit 780e2f1

Please sign in to comment.