summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-06-27 11:49:37 +0200
committerMartin Fischer <martin@push-f.com>2022-06-27 11:49:37 +0200
commit932197969e5c3004d62fe5e864ce3525f01e7aa5 (patch)
treed0474dcdc467390149bc452c182b0f18e5702cc1
parentdc5bb4b67b101e3586daffe113663e32e345a831 (diff)
convert lengths to km & round to one digitHEADmaster
-rwxr-xr-xfetch_data.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/fetch_data.py b/fetch_data.py
index 0a05d8a..aa5061f 100755
--- a/fetch_data.py
+++ b/fetch_data.py
@@ -152,10 +152,10 @@ def query_overpass(relation_ids: Collection[int], with_length: bool):
data = dict(tags={k: v for k, v in rel['tags'].items() if k in KEYS})
if with_length:
- data['mapped_length'] = round(get_length(rel, all_relations))
+ data['mapped_length'] = round(get_length(rel, all_relations) / 1000, 1)
wikidata_id = rel['tags'].get('wikidata')
if wikidata_id in wikidata_lengths:
- data['wikidata_length'] = wikidata_lengths[wikidata_id]
+ data['wikidata_length'] = round(wikidata_lengths[wikidata_id] / 1000, 1)
relations[rel_id] = data