Skip to content

Commit

Permalink
fix: add condition to raise valueerror if no features are found in aoi
Browse files Browse the repository at this point in the history
  • Loading branch information
Gigaszi committed Dec 3, 2024
1 parent bfa0818 commit 816b1e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mapswipe_workers/mapswipe_workers/utils/process_mapillary.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def get_image_metadata(
):
aoi_polygon = geojson_to_polygon(aoi_geojson)
downloaded_metadata = coordinate_download(aoi_polygon, level, attempt_limit)
if downloaded_metadata.isna().all().all() or downloaded_metadata.empty:
raise ValueError("No Mapillary Features in the AoI.")
downloaded_metadata = downloaded_metadata[
downloaded_metadata["geometry"].apply(lambda geom: isinstance(geom, Point))
]
Expand Down

0 comments on commit 816b1e6

Please sign in to comment.