Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # Initialize San Francisco mapping
  2. map_center_coordinates = (37.7749, -122.4194)
  3. m = folium.Map(location=map_center_coordinates, tiles="Stamen Terrain", zoom_start=12)
  4. # Load the processed graph of San Francisco
  5. trj = Trajectory('../datasets/sanfrancisco.jb')
  6. obj = np.random.choice(list(trj.G.keys()), 6)
  7. # Build five random objectives given one starting point
  8. for i in range(5):
  9. pth = trj.shortest_path(obj[0], obj[i+1])
  10. pts = np.asarray([np.asarray(e.split(':')).astype('float')[::-1] for e in pth])
  11. folium.PolyLine(pts, color="blue", weight=5, opacity=0.5).add_to(m)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement