def route(): temp_list1 = make_info_list.make_info_list(" ", session['startpoint']) temp_list2 = make_info_list.make_info_list(" ", session['endpoint']) start_x, start_y = make_info_list.find_xy(temp_list1) end_x, end_y = make_info_list.find_xy(temp_list2) total_route_list, stations_from_start, stations_from_end = find_route(start_x, start_y, end_x, end_y) print(total_route_list) sol = select_final_route.sol(total_route_list) print(sol) # print(len(sol["stations_from_end"])) length=len(sol["stations_from_end"]) return render_template('routepage.html', sol = sol, length=length)
def add_fav_pro(): favoriteTitle = request.form['favoriteTitle'] temp_list = make_info_list.make_info_list("",session['point']) favoriteAddr =temp_list[0][1] favoriteX,favoriteY = make_info_list.find_xy(temp_list) userID=session['userid'] ft.add_favorite(favoriteTitle, favoriteAddr, favoriteX, favoriteY, userID) show_favorite_list = ft.show_favorite(session['userid']) session.pop('point', None) return render_template('favorite.html', show_favorite_list = show_favorite_list)
def list3(): point = request.form['point'] candidate_list3 = make_candidate_list.find_candidate(point) xy_list=[] for i in candidate_list3: temp_list=make_info_list.make_info_list(i['title'],i['address']) try: x,y=make_info_list.find_xy(temp_list) xy_list.append([float(y),float(x)]) except: xy_list.append([0.00000000000001,0.00000000000001]) print(len(xy_list)) len_list = len(xy_list) return render_template('listpage3.html', candidate_list3=candidate_list3, xy_list = xy_list, len_list = len_list)
def list(): # session['startpoint'] = request.form['startpoint'] # startpoint = session['startpoint'] startpoint = request.form['startpoint'] candidate_list1 = make_candidate_list.find_candidate(startpoint) print('aaaa',candidate_list1) xy_list=[] for i in candidate_list1: temp_list=make_info_list.make_info_list(i['title'],i['address']) try: x,y=make_info_list.find_xy(temp_list) xy_list.append([float(y),float(x)]) except: xy_list.append([0.00000000000001,0.00000000000001]) print(len(xy_list)) len_list = len(xy_list) return render_template('listpage.html', candidate_list1=candidate_list1,xy_list = xy_list, len_list = len_list)