コード例 #1
0
ファイル: speedLimits.py プロジェクト: joannamazer/webAPI_new
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)
コード例 #2
0
	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)
コード例 #3
0
ファイル: map.py プロジェクト: joannamazer/webAPI_new
def get_waze_nodes(complete_waze, parsed_waze):
    waze_coords = traffic.get_route(complete_waze)  # waze link coord

    waze_data = {}
    points = []
    waze_lat = []
    waze_lon = []
    waze_type = []
    waze_speed = []
    node = 0

    for i in range(len(waze_coords)):
        node = node + 1
        waze_data[node] = {}

        lat = waze_coords[i][0]
        lon = waze_coords[i][1]

        waze_lat.append(lat)
        waze_lon.append(lon)
        waze_type.append('WAZE')
        points.append([lat, lon])

        waze_data[node]['lat'] = lat
        waze_data[node]['lon'] = lon
        waze_data[node]['speed'] = parsed_waze[node]['speed']
        waze_data[node]['ele'] = '0'
        print waze_coords[i][1]
        waze_data[node]['type'] = 'WAZE'

    elevation = Elevation()
    # print elevation.getElevations(points)
    elevation_output = elevation.getElevations(points)

    node = 0

    for i in elevation_output:
        node = node + 1
        waze_data[node]['ele'] = i
    map_functions.export_to_JSON(waze_data, 'waze_nodes.json')
    map_functions.plot_coords(waze_lat, waze_lon, waze_type, 16,
                              'waze_nodes.html')
    return waze_data
コード例 #4
0
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)
コード例 #5
0
ファイル: test.py プロジェクト: joannamazer/webAPI_new
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)