コード例 #1
0
def transit_route_match_score(segment,step1=100000,step2=100000,method='lcs',radius1=2500,threshold=0.5):
    Transits=get_transit_db()
    transitMatch={}
    route_seg=getRoute(segment['_id'])
    for type in Transits.distinct('type'):
        for entry in Transits.find({'type':type}):
            transitMatch[type]=matchTransitRoutes(route_seg,entry['stops'],step1,step2,method,radius1,threshold)
            if transitMatch[entry['type']]==1:
                break
    return transitMatch
コード例 #2
0
def transit_route_match_score(segment, step1=100000, step2=100000, method="lcs", radius1=2500, threshold=0.5):
    Transits = get_transit_db()
    transitMatch = {}
    route_seg = getRoute(segment["_id"])
    for type in Transits.distinct("type"):
        for entry in Transits.find({"type": type}):
            transitMatch[type] = matchTransitRoutes(route_seg, entry["stops"], step1, step2, method, radius1, threshold)
            if transitMatch[entry["type"]] == 1:
                break
    return transitMatch