Ejemplo n.º 1
0
 def load_trip_info_for_matcher(self, trip_id):
     date = datetime.datetime.strptime(trip_id.split('_')[0], '%d%m%y').date()
     trip = gtfs.models.Trip.objects.filter(trip_id = trip_id)
     stop_times_gtfs = gtfs.models.StopTime.objects.filter(trip = trip_id).order_by('arrival_time')
     detected_stop_times_gtfs = [DetectedStopTime.load_from_gtfs(x, date) for x in stop_times_gtfs]      
     relevant_services = gtfs.models.Service.objects.filter(start_date \
                                                           = date)
     relevant_service_ids = [x[0] for x in relevant_services.all().values_list(\
        'service_id')]
     return detected_stop_times_gtfs, relevant_service_ids
Ejemplo n.º 2
0
 def load_trip_info_for_matcher(self, trip_id):
     day = datetime.datetime.strptime(trip_id.split("_")[0], "%d%m%y").date()
     trip = timetable.services.get_trip(trip_id)
     stop_times_gtfs = trip.get_stop_times()
     detected_stop_times_gtfs = [DetectedStopTime.load_from_gtfs(x, day) for x in stop_times_gtfs]
     return detected_stop_times_gtfs, day