Skip to content

Commit 816b1e6

Browse files
committed
fix: add condition to raise valueerror if no features are found in aoi
1 parent bfa0818 commit 816b1e6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mapswipe_workers/mapswipe_workers/utils/process_mapillary.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def get_image_metadata(
229229
):
230230
aoi_polygon = geojson_to_polygon(aoi_geojson)
231231
downloaded_metadata = coordinate_download(aoi_polygon, level, attempt_limit)
232+
if downloaded_metadata.isna().all().all() or downloaded_metadata.empty:
233+
raise ValueError("No Mapillary Features in the AoI.")
232234
downloaded_metadata = downloaded_metadata[
233235
downloaded_metadata["geometry"].apply(lambda geom: isinstance(geom, Point))
234236
]

0 commit comments

Comments
 (0)