compute-regions.py

changeset 27
f89504285945
parent 7
f3791dccfd03
child 31
60045b362d71
equal deleted inserted replaced
26:69cc75506d4f 27:f89504285945
10 representatives = json.load(file) 10 representatives = json.load(file)
11 11
12 bus_stops = {} 12 bus_stops = {}
13 13
14 with open('gtfs/stops.txt') as file: 14 with open('gtfs/stops.txt') as file:
15 for rivi in lue_csv(file): 15 for row in read_csv(file):
16 sijainti = Sijainti(float(rivi['stop_lat']), float(rivi['stop_lon'])) 16 location = Sijainti(float(row['stop_lat']), float(row['stop_lon']))
17 tunniste = rivi['stop_id'] 17 reference = row['stop_id']
18 bus_stops[tunniste] = sijainti 18 bus_stops[reference] = location
19 19
20 district_shapes = [] 20 district_shapes = []
21 for polygon in data[1].splitlines(): 21 for polygon in data[1].splitlines():
22 polygon = polygon.split('^') 22 polygon = polygon.split('^')
23 coordinates = [] 23 coordinates = []

mercurial