def track_pickup(track_id, track_geom, track_desc, track_oorc): pickup_dict = {} pickup_dict['track_id'] = track_id track_geom_lonlats = graph.geom2lonlats(track_geom) pickup_lonlat = track_geom_lonlats[0] pickup_dict['pickup_lonlat'] = pickup_lonlat pickup_time = track_desc.split(',')[0] pickup_dict['pickup_time'] = pickup_time pickup_dict['track_oorc'] = track_oorc return pickup_dict
def track_dropoff(track_id, track_geom, track_desc, track_oorc): dropoff_dict = {} dropoff_dict['track_id'] = track_id track_geom_lonlats = graph.geom2lonlats(track_geom) track_geom_lonlats_length = len(track_geom_lonlats) dropoff_lonlat = track_geom_lonlats[track_geom_lonlats_length - 1] dropoff_dict['dropoff_lonlat'] = dropoff_lonlat dropoff_time = track_desc.split(',')[track_geom_lonlats_length - 1] dropoff_dict['dropoff_time'] = dropoff_time dropoff_dict['track_oorc'] = track_oorc return dropoff_dict