From 4e8ab046dc70d39bed49cbac3dd6f0da9610a5e4 Mon Sep 17 00:00:00 2001 From: Davide Fioriti <67809479+davide-f@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:21:43 +0100 Subject: [PATCH] Fix missing shape locate_bus (#1194) --- scripts/_helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/_helpers.py b/scripts/_helpers.py index ce97f6171..5beacdcf6 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -1300,6 +1300,9 @@ def locate_bus( # insert any variable into that place using .format - extract string and filter for those containing co (MA) point = Point(coords["x"], coords["y"]) # point object + if gdf_co.empty: + return None + try: return gdf_co[gdf_co.contains(point)][ col