Skip to content

Commit

Permalink
Merge pull request #47 from openaddresses/fix-iterate-feature
Browse files Browse the repository at this point in the history
Fix iterating over geojson-ld
  • Loading branch information
iandees authored Sep 1, 2023
2 parents 82fa599 + 4c9fbbe commit 8ed5eb2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion openaddr/slippymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ def iterate_file_features(filename):
open_file = open(filename, 'r')
elif suffix == '.zip':
open_file = open(filename, 'rb')
elif suffix == '.geojson':
open_file = open(filename, 'r')
else:
raise ValueError('Unknown file type: {}'.format(filename))

with open_file as file:
if suffix == '.csv':
if suffix == '.geojson':
for line in file:
feature = json.loads(line)
yield feature
return
elif suffix == '.csv':
csv_file = file
elif suffix == '.zip':
zip = ZipFile(file)
Expand Down

0 comments on commit 8ed5eb2

Please sign in to comment.