summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2020-11-05 16:42:34 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2020-11-05 16:42:34 +0100
commit5bd68cac4b2aa953bcc63e8e903ed8c5f2aec5c2 (patch)
tree0dc363b1973ee4b2c483ab70091afc6da0009a7a
parent2eef624ac866070dbfec8a88e4b76cba4a4593d8 (diff)
downloadtdde25-5bd68cac4b2aa953bcc63e8e903ed8c5f2aec5c2.tar.gz
remove nodes without neighbours
-rw-r--r--store.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/store.py b/store.py
index fa5e5dc..253087d 100644
--- a/store.py
+++ b/store.py
@@ -45,6 +45,11 @@ def extract_osm_nodes(f_name):
add_neighbours(nodes)
+ # remove nodes without neighbours
+ for node_id, node in nodes.copy().items():
+ if not node.neighbours:
+ del nodes[node_id]
+
return nodes