Skip to content

Commit 0c5dded

Browse files
fixed if statement to check union_all when geopandas>1.0
1 parent 96e0b77 commit 0c5dded

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

superblockify/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ def preprocess_graph(G: MultiDiGraph, boundary_buffer_dist: float = 200) -> Mult
125125

126126
# Create a convex hull of the graph to calculate the area and set the boundary for saving the graph.
127127
# This is implemented with an if statement to support older versions of geopandas < 1.0.0
128-
if hasattr(edges_gdf.geometry, "unary_union"):
129-
edge_union = edges_gdf.geometry.unary_union
130-
else:
128+
if hasattr(edges_gdf.geometry, "union_all"):
131129
edge_union = edges_gdf.geometry.union_all()
130+
else:
131+
edge_union = edges_gdf.geometry.unary_union
132132

133133
# A convex hull is created arround the bufferred edges.
134134
enclosing_hull = edge_union.buffer(boundary_buffer_dist).convex_hull

0 commit comments

Comments
 (0)