We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ecdc560 commit ce91ba2Copy full SHA for ce91ba2
momepy/streetscape.py
@@ -900,12 +900,12 @@ def _compute_sigthlines_plot_indicators_one_side(
900
match_geom = None
901
902
if not gdf_items.empty:
903
- _distances = gdf_items.exterior.intersection(
904
- sightline_geom
905
- ).distance(s_pt1)
906
- match_id = _distances.idxmin()
907
- match_distance = _distances.min()
908
- 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]
909
910
parcel_ids = []
911
# ---------------
0 commit comments