bmtc/scripts/route_name.py
Sajjad Anwar 716437bb90 2015 data
2016-02-03 12:10:12 +05:30

18 lines
328 B
Python

import json
routes = json.load(open('data/routes.json', 'r'))
for route in routes['features']:
id = route['properties']['route']
# print len(id)
if (len(id) > 2):
route_id = id[:2]
else:
route_id = id[0]
route['properties']['id'] = route_id
# print route_id
print json.dumps(routes)