compute-regions.py

changeset 73
c56b0ef96514
parent 52
cab8d38fe5c6
child 88
3b86597c5a88
--- a/compute-regions.py	Thu Oct 26 18:02:27 2017 +0300
+++ b/compute-regions.py	Fri Nov 24 22:41:48 2017 +0200
@@ -27,6 +27,8 @@
 			bus_stops[reference] = location
 
 district_shapes = []
+districts = {}
+
 for polygon in data[1].splitlines():
 	polygon = polygon.split('^')
 	coordinates = []
@@ -34,8 +36,9 @@
 		x, y = point.split(',')
 		coordinates.append(Sijainti(float(x), float(y)))
 	district_shapes.append(Monikulmio(*coordinates))
+	if polygon[0] != 'undefined':
+		districts[polygon[0]] = district_shapes[-1]
 
-districts = {}
 bus_stop_districts = {}
 
 for name, stop_id in representatives.items():

mercurial