Skip to content

Commit

Permalink
added exception for when location geojson isn't true geojson
Browse files Browse the repository at this point in the history
  • Loading branch information
mtravis committed Nov 6, 2023
1 parent 02203c4 commit 04bd224
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions open_buildings/download_buildings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
def geojson_to_quadkey(data: dict) -> str:
if 'bbox' in data:
min_lon, min_lat, max_lon, max_lat = data['bbox']
elif data['type'] is 'Polygon':
coords = data['coordinates'][0]
min_lon = min_lat = float('inf')
max_lon = max_lat = float('-inf')
else:
coords = data['geometry']['coordinates'][0]
min_lon = min_lat = float('inf')
Expand Down

0 comments on commit 04bd224

Please sign in to comment.