Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire authored Apr 2, 2023
1 parent 21aa9a2 commit 117faf2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion inciweb_wildfires/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ def get_incidents():
coords = folder.find("Point").find("coordinates").text.split(",")

# Reformat as GeoJSON
p = Point(map(_safe_float, coords))
try:
p = Point(map(_safe_float, coords))
except Exception:
# If the point cannot be converted, skip it.
# Inciweb does sometimes ship malformed data
print(f"Point {coords} could not be parsed. Skipping this feature.")
continue
f = Feature(geometry=p, properties=d)

# Add it to the list
Expand Down

0 comments on commit 117faf2

Please sign in to comment.