diff options
-rwxr-xr-x | fetch_data.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fetch_data.py b/fetch_data.py index 3c77c78..a0753c4 100755 --- a/fetch_data.py +++ b/fetch_data.py @@ -141,7 +141,14 @@ def query_overpass(relation_ids: Collection[int], with_length: bool): wikidata_lengths = query_lengths_from_wikidata(wikidata_ids()) for rel_id in relation_ids: - rel = all_relations[rel_id] + rel = all_relations.get(rel_id) + if not rel: + # TODO: report 404 in generated data + print( + f'[warning] could not find relation {rel_id}', + file=sys.stderr, + ) + continue data = dict(tags={k: v for k, v in rel['tags'].items() if k in KEYS}) if with_length: |