Skip to content

Commit

Permalink
clip only what needs to be clipped
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis committed Jan 20, 2024
1 parent f7b0a7c commit 9de5899
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion momepy/functional/_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def tessellation(
).set_crs(gdf.crs)

if limit is not None:
return polygons.clip(limit)
to_be_clipped = polygons.sindex.query(limit.boundary, "intersects")
polygons.iloc[to_be_clipped] = polygons.iloc[to_be_clipped].intersection(limit)

Check warning on line 54 in momepy/functional/_elements.py

View check run for this annotation

Codecov / codecov/patch

momepy/functional/_elements.py#L52-L54

Added lines #L52 - L54 were not covered by tests

return polygons

Check warning on line 56 in momepy/functional/_elements.py

View check run for this annotation

Codecov / codecov/patch

momepy/functional/_elements.py#L56

Added line #L56 was not covered by tests

0 comments on commit 9de5899

Please sign in to comment.