def main2(): from_address = \ 'University of Washington, Seattle, WA, United States' to_address = \ 'Legend House, Roosevelt Way Northeast, Seattle, WA, United States' startpnt = '5336 8th Ave NE, Seattle, WA 98105' endpnt = 'Space Needle , Seattle, WA 98105' start_coords = traffic.address_to_coords(startpnt) end_coords = traffic.address_to_coords(endpnt) print start_coords print end_coords # Directly get the raw data from waze website waze_resp = traffic.get_waze_resp(start_coords, end_coords) #print json.dumps(waze_resp, indent=4, sort_keys=True) #exportToJSON(route, 'raw_route_data.txt') # Processed Route Data route_info = traffic.get_route_info(waze_resp) #print json.dumps(route_info, indent=4, sort_keys=True) route = traffic.get_route(waze_resp) print route #print json.dumps(route, indent=4, sort_keys=True) newroute = gmaps.snap_to_roads(route, interpolate=False)
def __init__(self, from_addr, to_addr): self.sl = SpeedLimits() start_coords = traffic.address_to_coords(from_addr) end_coords = traffic.address_to_coords(to_addr) response = traffic.get_waze_resp(start_coords, end_coords) route = traffic.get_route(response) self.route_info = traffic.get_route_info(response) print(self.route_info)
def main(): from_address = \ 'University of Washington, Seattle, WA, United States' to_address = \ 'Legend House, Roosevelt Way Northeast, Seattle, WA, United States' start_coords = traffic.address_to_coords(from_address) end_coords = traffic.address_to_coords(to_address) print start_coords print end_coords # Directly get the raw data from waze website waze_resp = traffic.get_waze_resp(start_coords, end_coords) # Processed Route Data route_info = traffic.get_route_info(waze_resp) route = traffic.get_route(waze_resp) ele = elevation.Elevation() elevations = ele.getElevations(route)
def main(): from_address = '4711 Ravenna AVE NE, Seattle, WA 98105' # 'University of Washington, Seattle, WA, United States' # '4711 Ravenna AVE NE, Seattle, WA 98105' to_address = '3900 E Stevens Way NE, Seattle, WA 98195' # 'Legend House, Roosevelt Way Northeast, Seattle, WA, United States' # '3900 E Stevens Way NE, Seattle, WA 98195' start_coords = traffic.address_to_coords(from_address) end_coords = traffic.address_to_coords(to_address) print start_coords print end_coords waze_resp = traffic.get_waze_resp(start_coords, end_coords) # raw data from waze website route_info = traffic.get_route_info(waze_resp) # processed route data route = traffic.get_route(waze_resp) traffic.exportToJSON(route, 'raw_route_data.json') traffic.plotOnMap(start_coords, route_info) ele = elevation.Elevation() elevations = ele.getElevations(route)
def main(): route = map_functions.intro() start_coords = route['start'] end_coords = route['end'] complete_waze = traffic.get_waze_resp( start_coords, end_coords) # raw data from waze as JSON parsed_waze = traffic.get_route_info( complete_waze) # processed route info as JSON map_functions.export_to_JSON(complete_waze, 'waze_complete.json') waze_count = parsed_waze['node_count'] map_functions.export_to_JSON(parsed_waze, 'waze_full_output.json') route_index = get_waze_nodes(complete_waze, parsed_waze) total_nodes = get_google_nodes(waze_count, route_index) g_lat = total_nodes[0] g_lon = total_nodes[1] g_type = total_nodes[2] map_functions.plot_coords(g_lat, g_lon, g_type, 16, 'total_nodes.html') map_functions.export_to_JSON(leg_node_array_total, 'total_nodes.json')