Skip to content

Commit

Permalink
BUG: fix corner case of empty intersection in streetscape (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis authored Nov 27, 2024
1 parent ecdc560 commit ce91ba2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions momepy/streetscape.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,12 +900,12 @@ def _compute_sigthlines_plot_indicators_one_side(
match_geom = None

if not gdf_items.empty:
_distances = gdf_items.exterior.intersection(
sightline_geom
).distance(s_pt1)
match_id = _distances.idxmin()
match_distance = _distances.min()
match_geom = gdf_items.geometry[match_id]
intersection = gdf_items.exterior.intersection(sightline_geom)
if not intersection.is_empty.all():
_distances = intersection.distance(s_pt1)
match_id = _distances.idxmin()
match_distance = _distances.min()
match_geom = gdf_items.geometry[match_id]

parcel_ids = []
# ---------------
Expand Down

0 comments on commit ce91ba2

Please sign in to comment.