예제 #1
0
파일: formats.py 프로젝트: mayfer/transit
def stop_times_to_dict(stop_times):
	trips = []
	for stoptime in stop_times:
		trip = {}
		trip['time'] = format_time(gtfs.parse_stop_time(stoptime.departure_time))
		trip['trip_id'] = stoptime.trip_id
		trips.append(trip)
	return trips
예제 #2
0
파일: formats.py 프로젝트: mayfer/transit
def trip_stops_to_dict(stop_times):
	stops = []
	for stoptime in stop_times:
		stop = {}
		stop['stop_id'] = stoptime.stop.stop_id
		stop['stop_name'] = stoptime.stop.stop_name.title()
		stop['latitude'] = stoptime.stop.stop_lat
		stop['longitude'] = stoptime.stop.stop_lon
		stop['time'] = format_time(gtfs.parse_stop_time(stoptime.departure_time))
		stops.append(stop)
	return stops