Exemplo n.º 1
0
 def is_file_name_match(self,userd,false_list):
     shapes = self.shapes.values()
     shapes = check_service_time(shapes,userd.service_ids,userd.hour)
     if len(shapes) == 0:
         return False, false_list
     shape_ids = [x.shape_id for x in shapes]
     res,false_list =  place.find_first(userd.lat,userd.lon,userd.acc,shape_ids, false_list)
     if res == True:
         return True, false_list
     else:
         return False, false_list
Exemplo n.º 2
0
def check(agency, userd):
    false_list = []
    trips = agency.get_all_trip_ids()
    trips = check_services(trips,userd.service_ids)
    if len(trips) == 0:
        return False, false_list
    trips = check_start_time(trips,userd.hour)
    if len(trips) == 0:
        return False, false_list
    shape_ids = [x.shape_id for x in trips]
    res,false_list =  place.find_first(userd.lat,userd.lon,userd.acc,shape_ids, false_list)
    if res == True:
        return agency, false_list
    else:
        return False, false_list
Exemplo n.º 3
0
def check(agency, userd):
    false_list = []
    trips = agency.get_all_trip_ids()
    trips = check_services(trips, userd.service_ids)
    if len(trips) == 0:
        return False, false_list
    trips = check_start_time(trips, userd.hour)
    if len(trips) == 0:
        return False, false_list
    shape_ids = [x.shape_id for x in trips]
    res, false_list = place.find_first(userd.lat, userd.lon, userd.acc,
                                       shape_ids, false_list)
    if res == True:
        return agency, false_list
    else:
        return False, false_list
Exemplo n.º 4
0
 def is_agency_match(self, userd, false_list):
     print self.agency_id
     shapes= self.get_all_trip_ids()
     shapes = check_service_time(shapes,userd.service_ids,userd.hour)
     #shapes = check_services(shapes ,userd.service_ids)
     #if len(shapes) == 0:
     #    print 'f1'
     #    return False, false_list
     #shapes = check_start_time(shapes,userd.hour)
     if len(shapes) == 0:
         print 'f2'
         return False, false_list
     shape_ids = [x.shape_id for x in shapes]
     print 'len',len(shape_ids)
     res,false_list =  place.find_first(userd.lat,userd.lon,userd.acc,shape_ids, false_list)
     if res == True:
         return True, false_list
     else:
         return False, false_list